find_unused_symbols
[references]
Finds likely-unused source symbols with zero non-self references. Skips generated code, overrides/interface implementations, and reflection-sensitive symbols by default.
Try it locally in the Glider playground
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| kinds | string | No | Optional kinds filter (comma-separated). Type, Class, Interface, Struct, Enum, Delegate, Method, Property, Field, Event. Type means any named type; the rest match the kind a result reports. |
| scope | json | No | Optional scope. Omit scope to search the solution. When supplied, set mode to solution, project, document, or pathPrefix. project requires projectName. document requires filePath. pathPrefix requires pathPrefix. Paths can be absolute or relative to solutionRoot. Set includeExternal to true when the tool supports external symbols. |
| accessibility | string | No | Accessibility filter. Default is 'Private,Internal'. Default: "Private,Internal" |
| excludeReflectionSensitive | boolean | No | Skip reflection- or activation-sensitive symbols. Default is true. Default: true |
| summaryOnly | boolean | No | Return grouped summaries without the paged symbol list. Default is false. Default: false |
| pathStyle | string | No | Path style: 'absolute' (default) or 'relative' (to solution root). Default: "absolute" |
| skip | number | No | Pagination offset. Default is 0. Default: 0 |
| take | number | No | Pagination size. Default is 200. Default: 200 |
| responseDetail | string | No | compact returns results and actionable state. full adds diagnostic metadata under responseDiagnostics. Default: "compact" |
Examples
Replace sample paths and symbol keys with values from your workspace.
Find likely-unused private members
Arguments
{
"accessibility": "Private,Internal"
}Full MCP request
Full MCP request
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "find_unused_symbols",
"arguments": {
"accessibility": "Private,Internal"
}
}
}Illustrative response
{
"success": true,
"totalCount": 2,
"paging": {
"total": 2
},
"items": [
{
"name": "BuildCache",
"kind": "Field",
"containingType": "SolutionManager",
"symbolKey": "...",
"filePath": "/path/to/SolutionManager.cs",
"lineNumber": 18,
"accessibility": "Private"
}
],
"summary": {
"byKind": [
{
"key": "Field",
"count": 1
},
{
"key": "Method",
"count": 1
}
]
}
}Summarize unused methods in one project
Arguments
{
"kinds": "Method",
"scope": {
"mode": "project",
"projectName": "MyProject"
},
"summaryOnly": true
}Full MCP request
Full MCP request
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "find_unused_symbols",
"arguments": {
"kinds": "Method",
"scope": {
"mode": "project",
"projectName": "MyProject"
},
"summaryOnly": true
}
}
}Response Notes
Returns likely-unused source symbols, optionally summarized by kind and project Results use top-level fields with success. Compact is the default; full adds responseDiagnostics. Both modes retain errors, coverage, partial state, and recovery advice.