gograph_source
Retrieve the complete Go source implementation for any named function, method, struct, interface, type, variable, or constant, including file paths and line numbers.
Instructions
Retrieve verbatim Go source for a named function, method, struct, interface, type, variable, or constant, including complete bodies or declarations. 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. Source reads are confined to regular .go files beneath the analyzed repository and reject symlink path components. Read-only; no side effects. WHEN TO USE: When you need a specific implementation or declaration 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 source (use gograph_node). RETURNS: Raw Go source blocks with file paths and line numbers. It errors when the symbol is absent or no matching block can be read safely; an ambiguous query may still return its safely readable matches.
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) |