get_type_hierarchy
[hierarchy]
Gets base types, interfaces, and derived types for a type. Requires a symbolKey.
Try it locally in the Glider playground
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| symbolKey | string | Yes | Opaque symbolKey from search_symbols, resolve_symbol, get_symbol_at_position, or any tool that returns symbolKey. Not a name. |
| includeBaseTypes | boolean | No | Include base types. Default is true. Default: true |
| includeInterfaces | boolean | No | Include interfaces. Default is true. Default: true |
| includeDerivedTypes | boolean | No | Include derived types. Default is true. Default: true |
| scope | json | No | Optional scope. Omit scope to search the solution. When supplied, set mode to solution, project, document, or pathPrefix. project requires projectName. document requires filePath. pathPrefix requires pathPrefix. Paths can be absolute or relative to solutionRoot. Set includeExternal to true when the tool supports external symbols. This scope applies to the derived type search. Base types and interfaces use no scope filter. |
| derivedSkip | number | No | Derived type paging offset. Default is 0. Default: 0 |
| derivedTake | number | No | Derived type paging size. Default is 200. Default: 200 |
| pathStyle | string | No | Path style: 'absolute' (default) or 'relative' (to solution root). Default: "absolute" |
| responseDetail | string | No | compact 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.
Get type hierarchy for a type symbolKey
Arguments
{
"symbolKey": "..."
}Full MCP request
Full MCP request
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "get_type_hierarchy",
"arguments": {
"symbolKey": "..."
}
}
}Illustrative response
{
"success": true,
"symbolKey": "...",
"baseTypes": [
{
"name": "ControllerBase",
"fullName": "Microsoft.AspNetCore.Mvc.ControllerBase",
"symbolKey": "..."
}
],
"interfaces": [],
"derivedPaging": {
"total": 1
},
"derivedTypes": [
{
"name": "UsersController",
"fullName": "MyApp.Controllers.UsersController",
"symbolKey": "...",
"filePath": "/path/to/UsersController.cs",
"lineNumber": 5
}
]
}Response Notes
Returns base types, interfaces, and derived types (derived types support paging) Results use top-level fields with success. Compact is the default; full adds responseDiagnostics. Both modes retain errors, coverage, partial state, and recovery advice.