find_unused_parameters
[references]
Finds likely-unused parameters with zero references inside their declaring method or constructor. Skips generated code and reflection-sensitive members by default.
Try it locally in the Glider playground
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| 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 for the containing member. Default is 'Private,Internal'. Default: "Private,Internal" |
| excludeReflectionSensitive | boolean | No | Skip parameters on reflection- or activation-sensitive members. Default is true. Default: true |
| summaryOnly | boolean | No | Return grouped summaries without the paged parameter 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 method parameters
Arguments
{
"accessibility": "Private,Internal"
}Full MCP request
Full MCP request
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "find_unused_parameters",
"arguments": {
"accessibility": "Private,Internal"
}
}
}Illustrative response
{
"success": true,
"totalCount": 1,
"paging": {
"total": 1
},
"items": [
{
"parameterName": "cancellationToken",
"containingSymbol": "RefreshCacheAsync",
"containingType": "CacheService",
"filePath": "/path/to/CacheService.cs",
"lineNumber": 54,
"projectName": "MyProject"
}
],
"summary": {
"byProject": [
{
"key": "MyProject",
"count": 1
}
]
}
}Summarize unused parameters in one project
Arguments
{
"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_parameters",
"arguments": {
"scope": {
"mode": "project",
"projectName": "MyProject"
},
"summaryOnly": true
}
}
}Response Notes
Returns likely-unused parameters, optionally summarized by containing project and member kind Results use top-level fields with success. Compact is the default; full adds responseDiagnostics. Both modes retain errors, coverage, partial state, and recovery advice.