get_type_dependencies

[analysis]

Analyzes type dependencies to show what types a given type uses and what types use it.

Parameters

NameTypeRequiredDescription
typeNamestringYesName of the type to analyze.
projectNamestringNoOptional project name to limit the search scope.
directionstringNoDependency direction: uses, used_by, or both.

Examples

Analyze dependencies for a type

Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_type_dependencies",
    "arguments": {
      "typeName": "SolutionManager"
    }
  }
}
Response
{
  "success": true,
  "data": {
    "typeName": "SolutionManager",
    "fullName": "Glider.Services.SolutionManager",
    "filePath": "/path/to/SolutionManager.cs",
    "usesCount": 4,
    "usedByCount": 2,
    "uses": [
      {
        "typeName": "Workspace",
        "fullName": "Microsoft.CodeAnalysis.Workspace",
        "namespace": "Microsoft.CodeAnalysis",
        "usageKind": "Field",
        "filePath": null,
        "isExternal": true
      }
    ],
    "usedBy": [
      {
        "typeName": "SolutionTools",
        "fullName": "Glider.Server.SolutionTools",
        "namespace": "Glider.Server",
        "usageKind": "Method",
        "filePath": "/path/to/SolutionTools.cs",
        "isExternal": false
      }
    ]
  },
  "error": null
}

Response

Returns types used by the target and types that reference it

Go to Playground to test this tool interactively.