Skip to main content
Glama

gograph_doc

Read-onlyIdempotent

Fetch Go documentation for any package, stdlib symbol, or third-party symbol by running go doc. Get raw doc text when call chains lead outside your project.

Instructions

Fetch Go documentation for a package, stdlib symbol, or third-party symbol by running go doc <query>. The handler does not query the graph, though the project-scoped MCP server must already have started with a usable artifact or buildable Go source. Filesystem-shaped queries are rejected, and the command is refused for source-tree links the Go toolchain may inspect across the selected root plus its effective module root, or the workspace root and member trees; .git and .gograph are excluded from that preflight. It also refuses a special recognized Go build input, linked/non-regular Go tool metadata (go.mod, go.sum, go.work, go.work.sum, or vendor/modules.txt), or a workspace member outside the workspace directory. Each applicable member directory, go.mod, and optional go.sum is validated first. Dependency and toolchain resolution remain open-world under the user's Go environment. WHEN TO USE: When a call chain reaches code outside the project. NOT TO USE: For project-internal symbols (use gograph_source or gograph_context). RETURNS: A one-element JSON array containing {query, output}, where output is the raw go doc text; an error when the query or repository input is unsafe, the symbol is not found, or go is unavailable.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe go doc query string. Examples: 'fmt.Errorf', 'net/http.HandleFunc', 'io.Reader', 'github.com/jackc/pgx/v5.Conn.QueryRow'
Behavior5/5

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

The description goes far beyond the annotations, detailing rejection of filesystem-shaped queries, refusal of certain source-tree links and Go metadata, validation of member directories/go.mod files, open-world dependency resolution, and return/error behavior. It fully discloses the safety and execution model without contradicting the read-only, idempotent, open-world hints.

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?

The description is lengthy but purposefully structured with clear sections (WHEN TO USE, NOT TO USE, RETURNS) and front-loaded with the core action. Every sentence adds value, though the dense security preflight details could be more compact. It remains readable and well-organized.

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?

The description is complete for a tool of this complexity. It covers the return format (one-element JSON array with query and output), error conditions, prerequisites, and behavioral edge cases. With no output schema and only one parameter, the description adequately fills all gaps.

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?

The schema already describes the query parameter with concrete examples, achieving 100% coverage. The description adds context about acceptable query types (package, stdlib, third-party) and restrictions (filesystem-shaped rejected), which is useful but not a significant departure from the schema. Thus the 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?

The description opens with a specific verb and resource: 'Fetch Go documentation for a package, stdlib symbol, or third-party symbol by running `go doc <query>`.' It clearly distinguishes from siblings by noting the tool does not query the graph and by explicitly contrasting with gograph_source and gograph_context for project-internal symbols.

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 ('When a call chain reaches code outside the project') and NOT TO USE ('For project-internal symbols (use gograph_source or gograph_context)') sections, naming alternative tools. It also states prerequisites about the MCP server needing a usable artifact or buildable source, giving clear context for when the tool is applicable.

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