Skip to main content
Glama

gograph_node

Read-onlyIdempotent

Fetch AST metadata for a Go symbol, package, or file: kind, signature, file path, line number, and doc comment without reading full source. Use for lightweight structural lookups.

Instructions

Fetch AST metadata for a named symbol, package, or file: kind, file path, line number, full signature (a constant's declared value), doc comment, and struct fields if applicable. An exact case-sensitive name or selector selects only that declaration; substring matching applies only when nothing matches exactly. WHEN TO USE: When you need structural metadata (kind, signature, line number) without the full source body — lighter than gograph_source for metadata-only lookups. NOT TO USE: For full source code (use gograph_source); for call relationships (use gograph_callers/gograph_callees). RETURNS: Node properties array with kind, file, line, and signature; empty when the name is not found.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "name": "<name>"
    },
    "name": "gograph_node"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesThe exact symbol, package path, or Go file name to inspect (e.g., 'Graph', 'internal/search', 'server.go')
rootNoAbsolute path of your checkout or worktree (alias cwd).
limitNoRows per page.
cursorNonext_cursor from the previous page.
intentionNoRationale; required with an active session.
session_idNoSession from session_create; omit for none.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv1.7.21
    • changedInput schema / properties / cursor / description
      Previous value: -"Opaque next_cursor for the same graph snapshot and result selection."New value: +"next_cursor from the previous page."
    • changedInput schema / properties / intention / description
      Previous value: -"Technical rationale, required for analytical calls selecting an active session."New value: +"Rationale; required with an active session."
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum rows per page; the byte budget may return fewer."New value: +"Rows per page."
    • changedInput schema / properties / root / description
      Previous value: -"Absolute path of the checkout you are working in (your cwd or git worktree). Must be this server's repository or one of its git worktrees; the answer then comes from that checkout's own graph. A path elsewhere is refused. Alias: cwd. Omit only when the configured checkout is the one you mean."New value: +"Absolute path of your checkout or worktree (alias cwd)."
    • changedInput schema / properties / session_id / description
      Previous value: -"Caller selector returned by session_create. Omission means an independent caller; never inherits server environment or another caller's session."New value: +"Session from session_create; omit for none."
  2. Changed3 schema fields changedv1.7.18
    • addedInput schema / properties / intention
      Added value: +{
      +  "description": "Technical rationale, required for analytical calls selecting an active session.",
      +  "type": "string"
      +}
    • addedInput schema / properties / root
      Added value: +{
      +  "description": "Absolute path of the checkout you are working in (your cwd or git worktree). Must be this server's repository or one of its git worktrees; the answer then comes from that checkout's own graph. A path elsewhere is refused. Alias: cwd. Omit only when the configured checkout is the one you mean.",
      +  "type": "string"
      +}
    • addedInput schema / properties / session_id
      Added value: +{
      +  "description": "Caller selector returned by session_create. Omission means an independent caller; never inherits server environment or another caller's session.",
      +  "type": "string"
      +}
  3. Changed2 schema fields changedv1.7.5
    • addedInput schema / properties / cursor
      Added value: +{
      +  "description": "Opaque next_cursor for the same graph snapshot and result selection.",
      +  "maxLength": 128,
      +  "type": "string"
      +}
    • addedInput schema / properties / limit
      Added value: +{
      +  "default": 100,
      +  "description": "Maximum rows per page; the byte budget may return fewer.",
      +  "maximum": 200,
      +  "minimum": 1,
      +  "type": "integer"
      +}
  4. Addedv1.5.3
  5. Removedv1.5.3
  6. Changed1 schema field changedv1.4.70
    • changedInput schema / properties / name / description
      Previous value: -"The symbol, package, or file name to look up"New value: +"The exact symbol, package path, or Go file name to inspect (e.g., 'Graph', 'internal/search', 'server.go')"
  7. First observedv1.0.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, openWorldHint=false, so the safety profile is covered. The description still adds genuinely non-obvious behavior: exact case-sensitive matching wins, substring matching only fires as a fallback, and the result is an empty node array rather than an error when the name is not found — the last point materially changes how an agent should interpret an empty response.

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?

It is front-loaded with the core action and return fields, then structured into labeled WHEN TO USE / NOT TO USE / RETURNS segments. Every sentence carries distinct information — no restatement of the name, no filler.

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?

With no output schema, the RETURNS clause does the necessary work of describing the returned node properties array and the empty-result case. Pagination (limit/cursor) and session parameters are fully documented in the schema, and the read-only nature is covered by annotations, leaving no material gap for a metadata lookup tool.

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

Parameters4/5

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

Schema description coverage is 100%, so the baseline is 3, but the description adds meaning the schema does not: the 'name' parameter is clarified as accepting a symbol, package path, or Go file name, and the exact-vs-substring matching rule governs how that value is interpreted. The other five parameters (root, limit, cursor, intention, session_id) are left entirely to the schema, so this is not a 5.

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 opening sentence names a specific verb (fetch) and resource (AST metadata for a named symbol, package, or file), then enumerates exactly what is returned: kind, file path, line number, signature, doc comment, struct fields. This explicitly separates it from gograph_source (source body) and gograph_callers/gograph_callees (relationships), so an agent can choose without opening another schema.

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?

The definition has explicit WHEN TO USE and NOT TO USE blocks, each naming the alternative tool and the condition that selects it (metadata-only vs full source vs call relationships). No inference is required to route between this and its named siblings.

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