[external]
Maps a NuGet package to compile assemblies and metadata reference identities, then summarizes semantic source usages of that package.
Try this tool in Playground.
| Name | Type | Required | Description |
|---|---|---|---|
| packageId | string | Yes | NuGet package ID to analyze. |
| packageVersion | string | No | Optional package version. Useful when multiple versions are restored. |
| projectName | string | No | Optional project name filter. |
| pathStyle | string | No | Path style: 'absolute' (default) or 'relative' (to solution root). |
| symbolsSkip | number | No | Symbol-summary pagination offset. Default is 0. |
| symbolsTake | number | No | Symbol-summary pagination size. Default is 200. |
| filesSkip | number | No | File-summary pagination offset. Default is 0. |
| filesTake | number | No | File-summary pagination size. Default is 200. |
| maxExampleLocations | number | No | Maximum sample locations or symbols to include per summary item. Default is 5. Use 0 to omit examples. |
Analyze usages for one package
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "find_package_usages",
"arguments": {
"packageId": "System.Text.Json"
}
}
}{
"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
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "find_package_usages",
"arguments": {
"packageId": "Newtonsoft.Json",
"packageVersion": "13.0.3"
}
}
}{
"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
}Returns package-to-assembly mapping plus project, file, and symbol usage summaries