find_package_usages

[external]

Maps a NuGet package to compile assemblies and metadata reference identities, then summarizes semantic source usages of that package.

Why this tool exists

Framework and package behavior often explains local code, but the source is outside the repo.

How it helps the agent

The model can inspect external definitions and package usage evidence instead of guessing from API names.

Parameters

NameTypeRequiredDescription
packageIdstringYesNuGet package ID to analyze.
packageVersionstringNoOptional package version. Useful when multiple versions are restored.
projectNamestringNoOptional project name filter.
pathStylestringNoPath style: 'absolute' (default) or 'relative' (to solution root).
symbolsSkipnumberNoSymbol-summary pagination offset. Default is 0.
symbolsTakenumberNoSymbol-summary pagination size. Default is 200.
filesSkipnumberNoFile-summary pagination offset. Default is 0.
filesTakenumberNoFile-summary pagination size. Default is 200.
maxExampleLocationsnumberNoMaximum sample locations or symbols to include per summary item. Default is 5. Use 0 to omit examples.

Examples

Analyze usages for one package

Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "find_package_usages",
    "arguments": {
      "packageId": "System.Text.Json"
    }
  }
}
Response
{
  "success": true,
  "data": {
    "packageId": "System.Text.Json",
    "packageVersion": "9.0.0",
    "mappedAssemblies": [
      {
        "assemblyName": "System.Text.Json",
        "referenceIdentity": "System.Text.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51"
      }
    ],
    "projectSummaryCount": 1,
    "fileSummaryCount": 2,
    "symbolSummaryCount": 3,
    "files": [
      {
        "filePath": "/path/to/JsonService.cs",
        "usageCount": 4
      }
    ],
    "symbols": [
      {
        "symbolName": "JsonSerializer.Serialize",
        "usageCount": 3
      }
    ]
  },
  "error": null
}

Disambiguate between restored versions

Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "find_package_usages",
    "arguments": {
      "packageId": "Newtonsoft.Json",
      "packageVersion": "13.0.3"
    }
  }
}
Response
{
  "success": true,
  "data": {
    "packageId": "System.Text.Json",
    "packageVersion": "9.0.0",
    "mappedAssemblies": [
      {
        "assemblyName": "System.Text.Json",
        "referenceIdentity": "System.Text.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51"
      }
    ],
    "projectSummaryCount": 1,
    "fileSummaryCount": 2,
    "symbolSummaryCount": 3,
    "files": [
      {
        "filePath": "/path/to/JsonService.cs",
        "usageCount": 4
      }
    ],
    "symbols": [
      {
        "symbolName": "JsonSerializer.Serialize",
        "usageCount": 3
      }
    ]
  },
  "error": null
}

Response Notes

Returns package-to-assembly mapping plus project, file, and symbol usage summaries

↑/↓ NavigateEnter OpenSpace Expand