Browse documentation

get_method_source

[analysis]

Read a method or constructor by its exact source key.

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

Before this call

For stale_key caused by a changed or unreadable source, stabilize the file and call sync. After sync succeeds, repeat matching parser declaration discovery and retry with the new source key. If an old source key is only absent after a successful refresh, repeat matching parser declaration discovery in the current generation without another sync. Select a matching declaration kind. Type reads accept class, interface, enum, record, or annotation keys.

Parameters

NameTypeRequiredDescription
symbolKeystringYesOpaque key returned by declaration discovery in the current generation.

Examples

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

Illustrative arguments

Arguments
{
  "symbolKey": "<returned-symbolKey>"
}
Full MCP request
Full MCP request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_method_source",
    "arguments": {
      "symbolKey": "<returned-symbolKey>"
    }
  }
}

Response notes

Reports declaration, text, contentVersion, returnedSpan, readMode, and outputTruncated. Source includes leading Javadoc. Lines and UTF-16 columns start at one; span ends are exclusive. CRLF is one line break. Responses have a 128 KiB UTF-8 JSON cap. Use get_file_contents windows for truncated text.