Skip to main content
Glama

gograph_source

Read-onlyIdempotent

Retrieve the complete Go source code for any named function, method, struct, or interface, including its full body and file location, without opening the entire file.

Instructions

Retrieve the verbatim Go source code for a named function, method, struct, or interface, including its complete body. Requires .gograph/graph.json — run gograph build . first. 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

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

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

Annotations already declare read-only and idempotent. Description adds error conditions (symbol not found, source file unreadable) and return format (raw source with path/line numbers), providing full transparency.

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

Conciseness4/5

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

Well-structured with sections and front-loaded purpose. Slightly verbose but every sentence adds value; could be slightly tighter.

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?

For a simple retrieval tool with one parameter and no output schema, description covers purpose, usage guidelines, prerequisites, return format, and error cases. Completely adequate.

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 covers 100% of the single parameter 'symbol' with description. Description does not add extra parameter semantics beyond schema, so baseline 3 is appropriate.

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?

Clearly states it retrieves verbatim Go source code for named symbols (function, method, struct, interface). Distinguishes from siblings by explicitly mentioning call hierarchy and AST metadata alternatives.

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?

Includes explicit WHEN TO USE and NOT TO USE sections, provides alternatives (gograph_callers/gograph_callees, gograph_node), and mentions prerequisite .gograph/graph.json with build command.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ozgurcd/gograph'

If you have feedback or need assistance with the MCP directory API, please join our Discord server