Skip to main content
Glama

get_call_graph

Analyze a codebase symbol to map its callers, callees, or both, revealing how functions and classes connect. Trace dependencies and assess code impact.

Instructions

Get the call graph for a symbol: what calls it and what it calls.

Args:
    symbol: The function/class name to analyze
    directory: Path to the codebase directory
    direction: 'callers' (who calls this), 'callees' (what this calls), or 'both'

Returns:
    Call graph showing relationships

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": {
      "symbol": "<symbol>",
      "directory": "<directory>"
    },
    "name": "get_call_graph"
  }
}

Input Schema

NameRequiredDescriptionDefault
symbolYes
directionNoboth
directoryYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.1/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It implies a read-only analysis but says nothing about whether the codebase must be indexed, cost/latency on large directories, or how incomplete results may be. The 'Returns: Call graph showing relationships' line is too vague to compensate.

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 summary sentence followed by a clean Args block. The Returns section is largely redundant since an output schema exists, but otherwise the description is tight with no filler.

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

Completeness3/5

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

A three-parameter analysis tool with an output schema is reasonably covered: parameters are explained and return shape is delegated to the schema. Missing, however, are prerequisites (indexing) and any hint of relationship to neighboring lookup tools, which an agent needs to choose 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 0% (bare string types, no enum declared), yet the description documents all three parameters and gives the meaning of each direction value ('callers', 'callees', 'both'). That is real added meaning beyond the schema; only the exact format expected for symbol and directory is left implicit.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Get the call graph for a symbol') and immediately disambiguates with 'what calls it and what it calls'. That distinguishes it usefully from reference-listing siblings like find_references, though no sibling is named explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no when-to-use guidance: nothing says when to prefer this over find_references or get_related_symbols, nor whether the directory must be indexed first (siblings include index_directory and sync_index, implying a prerequisite). The only usage-like help is the direction parameter's options.

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