Skip to main content
Glama

gograph_callers

Read-onlyIdempotent

Finds the functions and methods that call a specified Go function or interface method, with optional caller depth, so you can assess upstream usages before renaming or changing signatures.

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. In an AST graph, a method call whose receiver type is spelled in the calling function (receiver, typed parameter or var, composite literal, then struct fields), or that is called directly on T{}, new(T) or x.(T), is not matched to a same-name method of another type, and a receiver of a package outside the graph (bytes.Buffer) matches no repository method; unknown receivers stay candidates. 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.

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": {
      "function": "<function>"
    },
    "name": "gograph_callers"
  }
}

Input Schema

NameRequiredDescriptionDefault
rootNoAbsolute path of your checkout or worktree (alias cwd).
depthNoTraversal depth from 1 to 10 (default 1)
exactNoRequire an exact symbol-name or fully-qualified-ID match
limitNoRows per page.
cursorNonext_cursor from the previous page.
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
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. 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"
      +}
  5. Addedv1.5.4
  6. Removedv1.5.3
  7. 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"
      +}
  8. 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)"
  9. 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')"
  10. First observedv1.0.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), yet the description still adds real behavioral context: default one-hop fan-in, depth 2-10 expansion, interface dispatch through all recorded implementations with deduplicated shared call sites, and detailed AST-graph matching rules for receiver types including the unknown-receiver fallback. It also documents the mermaid return variant.

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, so an agent can skim to what it needs. The AST-matching sentence is dense and long, but it carries non-obvious disambiguation semantics rather than 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?

For a 10-parameter read tool with no output schema, the description supplies the return shape (caller symbols, package paths, file locations, call-site line numbers, optional Mermaid), paging context via cursor/limit, and the graph-mode nuances an agent needs to interpret results correctly.

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 description coverage is 100%, so the schema already explains root, exact, limit, cursor, mermaid, no_tests, intention, and session_id. The description adds meaning mainly for depth (one-hop default versus caller-of-caller expansion) and indirectly for the precise-vs-AST graph distinction, but does not clarify the remaining parameters beyond what is already structured.

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?

Opens with a specific verb-plus-resource: find functions and methods that call the specified function or interface method. It immediately establishes directionality (callers, not callees), which is exactly what separates it from the sibling gograph_callees.

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 an explicit WHEN TO USE (before renaming, removing, or changing a signature) and a NOT TO USE clause that names both alternatives and the condition selecting each: gograph_impact for unbounded upstream blast radius, gograph_callees for downstream. No inference required.

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