Skip to main content
Glama

gograph_source

Read-onlyIdempotent

Retrieve verbatim Go source for a named symbol to inspect its implementation without opening entire files. Returns source with 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. Text and gograph.read.v1 structured content both carry the source or a named refusal: absent symbol, ambiguity with candidates, unsafe/unreadable source, invalid indexed range, or source exceeding 65536 bytes (with its size).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesThe name of the symbol to retrieve source for (supports short name 'ValidateToken', dot-notation 'graph.Graph', or fully-qualified ID)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / symbol / description
      Previous value: -"The name of the symbol (e.g., 'ValidateToken' or 'AuthService')"New value: +"The name of the symbol to retrieve source for (supports short name 'ValidateToken', dot-notation 'graph.Graph', or fully-qualified ID)"
  2. First observedv1.0.0

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations (readOnly, idempotent, non-destructive, closed-world), the description discloses unusual behavior: a pre-call freshness check with mode-aware CHA/SSA retries, confinement to regular .go files under the repo, symlink path rejection, and a 65536-byte size cap. This is far more than the annotations carry and materially affects invocation expectations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action, then clearly delimited WHEN TO USE / NOT TO USE / RETURNS sections. Despite its length every clause is functional; there is no filler or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, yet the description fully compensates by explaining the return shape (raw Go source blocks with file paths and line numbers, mirrored in text and gograph.read.v1 structured content) and enumerating named refusal cases. An agent has everything needed to call and interpret results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% and the single 'symbol' parameter already documents short name, dot-notation, and fully-qualified ID forms. The description adds only a restatement of symbol kinds, which partially overlaps the enum of retrievable kinds but adds no new format or syntax detail beyond the schema, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (retrieve) and resource (verbatim Go source) with an enumerated scope of symbol kinds (function, method, struct, interface, type, variable, constant) and clarifies bodies vs declarations. The NOT TO USE section explicitly separates it from gograph_callers/gograph_callees and gograph_node, so an agent can disambiguate without opening schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit WHEN TO USE (targeted alternative to reading a whole file) and NOT TO USE clauses naming the correct alternatives for call hierarchy and AST metadata. Both the condition and the routing target are spelled out, leaving nothing to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.