Browse documentation

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

NameTypeRequiredDescription
filePathstringYesAbsolute file path.
linenumberYes1-based line number. Default: 1
columnnumberYes1-based UTF-16 column number on the current line. Default: 1
pathStylestringNoPath style: 'absolute' (default) or 'relative' (to solution root). Default: "absolute"
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.

Get symbol key under cursor

Arguments
{
  "filePath": "/Users/dev/MyProject/Program.cs",
  "line": 10,
  "column": 15
}
Full MCP request
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
    }
  }
}
Illustrative response
{
  "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.