get_symbol_at_position
[symbols]
Resolves the symbol at an exact file position. Addressable symbols return an opaque key.
Try it locally in the Glider playground
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| filePath | string | Yes | Absolute file path. |
| line | number | Yes | 1-based line number. Default: 1 |
| column | number | Yes | 1-based UTF-16 column number on the current line. Default: 1 |
| 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 symbol key under cursor
{
"filePath": "/Users/dev/MyProject/Program.cs",
"line": 10,
"column": 15
}Full MCP request
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "get_symbol_at_position",
"arguments": {
"filePath": "/Users/dev/MyProject/Program.cs",
"line": 10,
"column": 15
}
}
}{
"success": true,
"symbolKey": "...",
"displayName": "MyApp.Services.UserService",
"kind": "Class",
"containingType": null,
"filePath": "/path/to/UserService.cs",
"lineNumber": 12,
"addressableAncestor": null
}Response Notes
Returns symbol details and a nullable symbolKey. Locals, parameters, and local functions have no addressable key. Use addressableAncestor or the source location. The ancestor has symbolKey, displayName, and kind fields. An invalid line or column returns success:false with validRange (parameter, minimum, maximum). Read the current line and select the intended identifier before retrying; the tool does not choose another symbol. Results use top-level fields with success. Compact is the default; full adds responseDiagnostics. Both modes retain errors, coverage, partial state, and recovery advice.