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.

Why this tool exists

Safe edits depend on knowing real references, implementations, overrides, and unused members rather than matching text.

How it helps the agent

The model can see where code is actually used and avoid changing the wrong overload, interface, or similarly named member.

Parameters

NameTypeRequiredDescription
scopejsonNoOptional scope used to select methods and constructors to analyze.
accessibilitystringNoAccessibility filter for the containing member. Default is 'Private,Internal'.
excludeReflectionSensitivebooleanNoSkip parameters on reflection- or activation-sensitive members. Default is true.
summaryOnlybooleanNoReturn grouped summaries without the paged parameter list. Default is false.
pathStylestringNoPath style: 'absolute' (default) or 'relative' (to solution root).
skipnumberNoPagination offset. Default is 0.
takenumberNoPagination size. Default is 200.

Examples

Find likely-unused private method parameters

Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "find_unused_parameters",
    "arguments": {
      "accessibility": "Private,Internal"
    }
  }
}
Response
{
  "success": true,
  "data": {
    "totalCount": 1,
    "paging": {
      "skip": 0,
      "take": 200,
      "returned": 1,
      "total": 1
    },
    "items": [
      {
        "parameterName": "cancellationToken",
        "containingSymbol": "RefreshCacheAsync",
        "containingType": "CacheService",
        "filePath": "/path/to/CacheService.cs",
        "lineNumber": 54,
        "projectName": "MyProject"
      }
    ],
    "summary": {
      "byProject": [
        {
          "key": "MyProject",
          "count": 1
        }
      ]
    }
  },
  "error": null
}

Summarize unused parameters in one project

Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "find_unused_parameters",
    "arguments": {
      "scope": {
        "mode": "project",
        "projectName": "MyProject"
      },
      "summaryOnly": true
    }
  }
}
Response
{
  "success": true,
  "data": {
    "totalCount": 1,
    "paging": {
      "skip": 0,
      "take": 200,
      "returned": 1,
      "total": 1
    },
    "items": [
      {
        "parameterName": "cancellationToken",
        "containingSymbol": "RefreshCacheAsync",
        "containingType": "CacheService",
        "filePath": "/path/to/CacheService.cs",
        "lineNumber": 54,
        "projectName": "MyProject"
      }
    ],
    "summary": {
      "byProject": [
        {
          "key": "MyProject",
          "count": 1
        }
      ]
    }
  },
  "error": null
}

Response Notes

Returns likely-unused parameters, optionally summarized by containing project and member kind

↑/↓ NavigateEnter OpenSpace Expand