Skip to main content
Glama

get_call_graph

Read-onlyIdempotent

Build a bidirectional call graph centered on a symbol, revealing its callers and callees up to 20 levels deep. Trace control flow and dependency paths directly from source code.

Instructions

Build a bidirectional call graph centered on a symbol (who calls it + what it calls). Each branch keeps its direction: depth 2 = callers of callers, callees of callees. Use to understand control flow through a function. For flat list of all references use find_usages instead. Read-only. Returns JSON: { root: { symbol_id, name, calls: [...], called_by: [...] } }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fqnNoFully qualified name to center the graph on
depthNoTraversal depth on each side (default 2)
symbol_idNoSymbol ID to center the graph on

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv3.22.0
    • removedInput schema / required
      Removed value: -[
      -  "symbol_id",
      -  "fqn"
      -]
  2. Changed1 schema field changedv3.3.0
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
  3. Added
  4. Removedv1.38.0
  5. Changed2 schema fields changedv1.35.1
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / required
      Added value: +[
      +  "symbol_id",
      +  "fqn"
      +]
  6. First observedv0.1.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, and destructiveHint, and the description reinforces 'Read-only'. More importantly, it adds non-obvious behavior: branches keep their direction, depth 2 means callers of callers and callees of callees, and the JSON response shape is provided. A small gap is unspecified behavior when neither fqn nor symbol_id is provided.

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?

The description is compact and front-loaded: it opens with the core behavior, immediately explains depth semantics, provides an explicit alternative, and closes with output format. Every sentence earns its place with no redundancy or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is well covered: purpose, usage alternative, depth behavior, read-only safety, and return structure are all present, and annotations cover the safety profile. The main omission is that no parameter is required in the schema while the description assumes a symbol is centered, leaving the fqn-or-symbol_id contract implicit.

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. The description adds useful semantics beyond the schema by explaining what depth means concretely ('callers of callers, callees of callees') and reinforcing the bidirectional traversal. It does not clarify how fqn and symbol_id relate or take precedence, but the main parameter semantics are enriched.

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 is specific: it names the exact operation ('Build a bidirectional call graph centered on a symbol'), clarifies both call directions, and explains depth semantics. It also distinguishes itself from find_usages, making the tool's unique purpose immediately clear.

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?

It explicitly states when to use the tool ('Use to understand control flow through a function') and when not to, directing the agent to the correct alternative ('For flat list of all references use find_usages instead'). This is strong routing guidance among sibling tools.

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