Browse documentation

find_package_usages

[external]

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

UNRELEASED audit selector: check the installed schema. Released Glider 13.1.1 retains single-package semantic usage analysis.

Try it locally in the Glider playground

Parameters

NameTypeRequiredDescription
auditjsonNoPackage matrix: packageIds and optional contexts with projectPath, targetFramework, configuration, runtimeIdentifier. Empty RID selects portable evaluation; null leaves it unspecified. Omit contexts for discovery and inspect contextDiscoveryComplete. Limits: 100 package IDs, 100 contexts, and 2000 package-context rows, including discovered contexts. Pagination does not expand these limits. Split larger audits into smaller requests with explicit contexts. evaluateProjects defaults to false. Explicit true queries MSBuild properties/items, can load imports, and runs no targets or restore. includeAssetPaths defaults to false. skip defaults to 0; take defaults to 100, range 1–200. Follow the returned continuation with snapshotId unchanged. Unreleased. Check the installed schema.
packageIdstringRequired if audit is omittedNuGet package ID for semantic usage mode. Omit with audit.
packageVersionstringNoOptional package version. Useful when multiple versions are restored.
projectNamestringNoOptional project name filter.
pathStylestringNoPath style: 'absolute' (default) or 'relative' (to solution root). Default: "absolute"
symbolsSkipnumberNoSymbol-summary pagination offset. Default is 0. Default: 0
symbolsTakenumberNoSymbol-summary pagination size. Default is 200. Default: 200
filesSkipnumberNoFile-summary pagination offset. Default is 0. Default: 0
filesTakenumberNoFile-summary pagination size. Default is 200. Default: 200
maxExampleLocationsnumberNoMaximum sample locations or symbols to include per summary item. Default is 5. Use 0 to omit examples. Default: 5
responseDetailstringNocompact 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.

UNRELEASED: audit one exact project context

Arguments
{
  "audit": {
    "packageIds": [
      "Example.Widget"
    ],
    "contexts": [
      {
        "projectPath": "src/App/App.csproj",
        "targetFramework": "net10.0",
        "configuration": "Release",
        "runtimeIdentifier": ""
      }
    ],
    "evaluateProjects": true,
    "includeAssetPaths": true
  }
}
Full MCP request
Full MCP request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "find_package_usages",
    "arguments": {
      "audit": {
        "packageIds": [
          "Example.Widget"
        ],
        "contexts": [
          {
            "projectPath": "src/App/App.csproj",
            "targetFramework": "net10.0",
            "configuration": "Release",
            "runtimeIdentifier": ""
          }
        ],
        "evaluateProjects": true,
        "includeAssetPaths": true
      }
    }
  }
}
Illustrative response
{
  "success": true,
  "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
    }
  ]
}

Analyze usages for one package

Arguments
{
  "packageId": "System.Text.Json"
}
Full MCP request
Full MCP request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "find_package_usages",
    "arguments": {
      "packageId": "System.Text.Json"
    }
  }
}

Disambiguate between restored versions

Arguments
{
  "packageId": "Newtonsoft.Json",
  "packageVersion": "13.0.3"
}
Full MCP request
Full MCP request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "find_package_usages",
    "arguments": {
      "packageId": "Newtonsoft.Json",
      "packageVersion": "13.0.3"
    }
  }
}

Response Notes

Semantic mode returns package mappings and source usages. Incomplete assets return packagePresence=unknown when no identity resolves. Restore affected projects for the intended context, then reload. A package with no compile assets remains present. UNRELEASED audit mode returns a row for each requested package/context: direct, transitive, absent, or unknown. evaluatedDeclaration retains separate declaration facts. Partial restore and unverified project-reference graphs keep resolved relationships unknown. Passive evidence cannot establish absence from unevaluated declarations. The loader does not retain the actual evaluated configuration and RID, so passive selected workspace inputs remain unknown. Explicit global properties can change through imported local-property overrides. Request evaluateProjects=true with an exact context for separate evaluated-item evidence. Compare context with evaluatedContext, restoreCorrespondence, provenance, and project/assets hashes. availableAssets describes available package assets; targetAssets describes the restore target; selectedInputs describes evaluated input roles. None proves execution; execution remains unknown. Compact evidence returns pathCount with null paths; request includeAssetPaths for full lists. Reconcile requestedRows, coveredRows, skippedRows, presenceComplete, selectedInputsComplete, and pageComplete separately. Follow continuation unchanged; restart after snapshot changes. A missing row is not absence. Target-generated, native, or runtime evidence can remain unknown. Report those limits without endless retries. Neither zero C# usages nor complete presence coverage proves safe removal. Results use top-level fields with success. Compact is the default; full adds responseDiagnostics. Both modes retain errors, coverage, partial state, and recovery advice.