Browse documentation

get_symbol_at_position

[symbols]

Resolve the exact token at a Java source position.

Unreleased read-only preview. Technical reference for agents and client integrators.

Before this call

Whitespace and a position after a token return no symbol. An ambiguous_context lists available selections.

Parameters

NameTypeRequiredDescription
pathstringYesContained workspace file path. Use a nonblank string of at most 4096 characters.
linenumberYesOne-based source line.
columnnumberYesOne-based UTF-16 column.
modulestringNoExact imported module identifier.
scopestringNoCompiler scope.

Examples

Technical examples for agents and client integrators. Replace paths and opaque keys with returned workspace values.

Illustrative arguments

Arguments
{
  "path": "src/main/java/example/OrderService.java",
  "line": 12,
  "column": 18,
  "scope": "main"
}
Full MCP request
Full MCP request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_symbol_at_position",
    "arguments": {
      "path": "src/main/java/example/OrderService.java",
      "line": 12,
      "column": 18,
      "scope": "main"
    }
  }
}

Response notes

Returns an exact symbol only for a token that contains one. Select module and scope when several compiler contexts cover the file.