gograph_source
Retrieve complete Go source code for a named function, method, struct, or interface by symbol, with file path and line numbers. Provides targeted access to implementation details without loading entire files.
Instructions
Retrieve the verbatim Go source code for a named function, method, struct, or interface, including its complete body. The MCP server checks freshness before this call and refreshes in the current requested analysis mode; precise and precise_fallback graphs retry CHA/SSA after source changes. Read-only; no side effects. WHEN TO USE: When you need to read a specific implementation in full without loading a large file — a targeted alternative to reading the whole file. NOT TO USE: For call hierarchy information (use gograph_callers/gograph_callees); for AST metadata without the full body (use gograph_node). RETURNS: Raw Go source block with file path and line numbers; returns an error when the symbol is not found or the source file cannot be read.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | The name of the symbol to retrieve source for (supports short name 'ValidateToken', dot-notation 'graph.Graph', or fully-qualified ID) |