[references]
Finds likely-unused source symbols with zero non-self references. Skips generated code, overrides/interface implementations, and reflection-sensitive symbols by default.
Try this tool in Playground.
| Name | Type | Required | Description |
|---|---|---|---|
| kinds | string | No | Optional kinds filter (comma-separated): 'Type,Method,Property,Field,Event'. |
| scope | json | No | Optional scope used to select symbol definitions to analyze. |
| accessibility | string | No | Accessibility filter. Default is 'Private,Internal'. |
| excludeReflectionSensitive | boolean | No | Skip reflection- or activation-sensitive symbols. Default is true. |
| summaryOnly | boolean | No | Return grouped summaries without the paged symbol list. Default is false. |
| pathStyle | string | No | Path style: 'absolute' (default) or 'relative' (to solution root). |
| skip | number | No | Pagination offset. Default is 0. |
| take | number | No | Pagination size. Default is 200. |
Find likely-unused private members
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "find_unused_symbols",
"arguments": {
"accessibility": "Private,Internal"
}
}
}{
"success": true,
"data": {
"totalCount": 2,
"paging": {
"skip": 0,
"take": 200,
"returned": 2,
"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
}
]
}
},
"error": null
}Summarize unused methods in one project
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "find_unused_symbols",
"arguments": {
"kinds": "Method",
"scope": {
"mode": "project",
"projectName": "MyProject"
},
"summaryOnly": true
}
}
}{
"success": true,
"data": {
"totalCount": 2,
"paging": {
"skip": 0,
"take": 200,
"returned": 2,
"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
}
]
}
},
"error": null
}Returns likely-unused source symbols, optionally summarized by kind and project