Skip to main content
Glama

gograph_callers

Read-onlyIdempotent

Find all callers of a Go function or interface method before renaming, removing, or changing its signature; supports depth and returns call-site locations.

Instructions

Find functions and methods that call the specified function or interface method. Defaults to one-hop fan-in; depth 2-10 expands callers-of-callers. In a precise graph, Interface.Method expands through all recorded implementations and reports a shared source call site once. The MCP server refreshes source analysis before the call. Read-only; no persistent side effects. WHEN TO USE: Before renaming, removing, or changing a function or interface method signature. NOT TO USE: For unbounded upstream blast radius (use gograph_impact); for downstream callees (use gograph_callees). RETURNS: Caller symbols with package paths, file locations, and call-site line numbers; with mermaid=true, Mermaid flowchart text.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
depthNoTraversal depth from 1 to 10 (default 1)
exactNoRequire an exact symbol-name or fully-qualified-ID match
limitNoMaximum rows per page; the byte budget may return fewer.
cursorNoOpaque next_cursor for the same graph snapshot and result selection.
mermaidNoReturn Mermaid flowchart text instead of the normal response
functionYesThe target function or method (supports short name 'BuildGraph', interface notation 'Repository.Delete', concrete dot-notation 'Store.Delete', or a fully-qualified ID)
no_testsNoExclude call edges originating in *_test.go files

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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"
      +}
  2. Changed2 schema fields changedv1.5.6
    • changedInput schema / properties / depth / type
      Previous value: -"number"New value: +"integer"
    • addedInput schema / properties / mermaid
      Added value: +{
      +  "description": "Return Mermaid flowchart text instead of the normal response",
      +  "type": "boolean"
      +}
  3. Addedv1.5.4
  4. Removedv1.5.3
  5. Changed4 schema fields changed
    • addedInput schema / properties / depth
      Added value: +{
      +  "description": "Traversal depth from 1 to 10 (default 1)",
      +  "type": "number"
      +}
    • addedInput schema / properties / exact
      Added value: +{
      +  "description": "Require an exact symbol-name or fully-qualified-ID match",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / function / description
      Previous value: -"The name of the target function to find callers for (supports short name 'BuildGraph', dot-notation 'graph.Graph.Build', or fully-qualified ID)"New value: +"The target function or method (supports short name 'BuildGraph', interface notation 'Repository.Delete', concrete dot-notation 'Store.Delete', or a fully-qualified ID)"
    • addedInput schema / properties / no_tests
      Added value: +{
      +  "description": "Exclude call edges originating in *_test.go files",
      +  "type": "boolean"
      +}
  6. Changed1 schema field changed
    • changedInput schema / properties / function / description
      Previous value: -"The name of the target function to find callers for (e.g., 'BuildGraph', 'Serve')"New value: +"The name of the target function to find callers for (supports short name 'BuildGraph', dot-notation 'graph.Graph.Build', or fully-qualified ID)"
  7. Changed1 schema field changedv1.4.70
    • changedInput schema / properties / function / description
      Previous value: -"The name of the function being called (e.g., 'ValidateToken')"New value: +"The name of the target function to find callers for (e.g., 'BuildGraph', 'Serve')"
  8. First observedv1.0.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, openWorldHint=false and destructiveHint=false, so safety is covered; the description's 'Read-only; no persistent side effects' partly duplicates that. It adds genuine non-obvious behavior beyond the annotations: the server refreshes source analysis before the call, the default is one-hop fan-in with depth 2-10 expanding callers-of-callers, and interface method calls expand through implementations but report a shared source call site once.

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 front-loaded: the core action leads, then scope/defaults, then WHEN TO USE / NOT TO USE / RETURNS blocks. Dense but each block carries distinct information; only the 'Read-only; no persistent side effects' clause is somewhat redundant with annotations.

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, so the RETURNS block (caller symbols with package paths, file locations, call-site line numbers, and Mermaid text) is necessary and present. Combined with pagination notes implied by cursor/limit, the definition gives an agent everything needed to call it correctly.

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 real meaning the schema lacks: it explains the depth semantic (default one-hop vs 2-10 expanding callers-of-callers), the mermaid=true output switch, and the interface/concrete dot-notation behavior behind the 'function' and 'exact' parameters. These are usage-level semantics not stated in the schema descriptions.

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 and resource ('Find functions and methods that call the specified function or interface method') and immediately differentiates from siblings by contrasting with gograph_impact (upstream blast radius) and gograph_callees (downstream). An agent can distinguish it from the ~60 sibling tools without opening the 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?

Contains explicit WHEN TO USE ('Before renaming, removing, or changing a function or interface method signature') and NOT TO USE clauses that name alternative tools (gograph_impact, gograph_callees) with the conditions that select each. Nothing is left to inference.

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