Skip to main content
Glama

gograph_context

Read-onlyIdempotent

Fetch a pre-flight context bundle for a Go symbol—AST metadata, source, callers, callees, tests, and role—in one call before editing. Use uncommitted=true to bundle all modified symbols.

Instructions

Fetch a pre-flight context bundle for a single Go symbol: AST node metadata, source code, direct callers, direct callees, linked test functions, and architectural role classification — all in one call. Read-only analysis; an active audit session may append local command telemetry. Set uncommitted=true to bundle context for all currently modified symbols at once. WHEN TO USE: As the first call before editing a symbol — eliminates 4–5 separate tool roundtrips. NOT TO USE: For package-level orientation (use gograph_focus); for transitive blast radius (use gograph_impact). RETURNS: JSON with node (first match), nodes[] (all matches), source, callers[], callees[], tests[], test_results[], and top-level role; a missing symbol is a named error. source_error reports a partial context when indexed metadata exists but source cannot be served, also named in _meta.gograph_graph_state.read_diagnostic. With uncommitted=true, returns a contexts[] array; count:0 when no uncommitted symbols exist.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

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

Input Schema

NameRequiredDescriptionDefault
rootNoAbsolute path of your checkout or worktree (alias cwd).
exactNoRequire an exact symbol-name or fully-qualified-ID match in single-symbol mode.
symbolNoThe exact name, dot-notation 'graph.Graph', or ID of the symbol to retrieve context for.
intentionNoRationale; required with an active session.
session_idNoSession from session_create; omit for none.
uncommittedNoIf true, return context for all uncommitted modified symbols bundled in one response.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.7.21
    • 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 / 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. Changed1 schema field changed
    • addedInput schema / properties / exact
      Added value: +{
      +  "description": "Require an exact symbol-name or fully-qualified-ID match in single-symbol mode.",
      +  "type": "boolean"
      +}
  4. Changed1 schema field changed
    • changedInput schema / properties / symbol / description
      Previous value: -"The exact name or ID of the symbol to retrieve context for."New value: +"The exact name, dot-notation 'graph.Graph', or ID of the symbol to retrieve context for."
  5. First observedv1.0.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnlyHint/idempotentHint, but the description goes further: it discloses that an active audit session may append local command telemetry, that a missing symbol yields a named error, that source_error signals partial context with a diagnostic in _meta.gograph_graph_state.read_diagnostic, and that uncommitted=true changes the response shape to contexts[] with count:0 when empty. These are behavioral traits structured fields do not carry.

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?

Front-loaded with purpose, then clearly labeled WHEN TO USE / NOT TO USE / RETURNS blocks — highly scannable. It is dense and deep into error/diagnostic detail (source_error, _meta path), which is useful but pushes length beyond the minimum needed.

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 description fully carries the return contract (node, nodes[], source, callers[], callees[], tests[], test_results[], role, contexts[]), plus error and partial-result states. An agent has everything needed to call it correctly and interpret results without further discovery.

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 coverage is 100%, so baseline is 3, but the description adds meaning beyond the schema: it explains the uncommitted=true result contract (contexts[] array, count:0 when nothing is modified) and reinforces that symbol is resolved in single-symbol mode. The session_id/intention pairing is left to the schema.

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 first sentence names a specific verb and resource ('Fetch a pre-flight context bundle for a single Go symbol') and enumerates the payload (AST metadata, source, callers, callees, tests, role classification). It is immediately distinguishable from siblings like gograph_focus and gograph_impact, which are explicitly called out.

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?

Explicit WHEN TO USE ('first call before editing a symbol — eliminates 4–5 separate roundtrips') and NOT TO USE routing to gograph_focus for package orientation and gograph_impact for transitive blast radius. Both the selection condition and the alternatives are named, 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.