Skip to main content
Glama

trace_call_chain

Trace a function's callers and callees in a local codebase to map the impact of code changes.

Instructions

Trace a function's callers and callees across a checked-out repo (AST).

Complements dependency_impact: where dependency_impact lists every reference, this builds the directed call graph — where the symbol is defined, what it calls, and what calls it — so you can reason about a change's ripple effects. Tree-sitter-based; point it at a LOCAL clone of the repo.

Args: symbol: Function or class name to trace. root: Absolute path to the local repository clone. language: Restrict to one language; auto-detects if omitted. max_depth: Levels of callers/callees to follow (default 1).

Returns: {symbol, definition{file_path, line, type}, callees[...], callers[...], stats{files_scanned, parse_errors}}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rootYes
symbolYes
languageNo
max_depthNo
Behavior4/5

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

With no annotations, the description carries the full burden and does well by disclosing the AST/Tree-sitter approach, local-repo requirement, and returning parse_errors stats. However, it does not explicitly state whether the tool is read-only or mention limitations like language support coverage, which prevents a perfect score.

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 well-structured with a purpose statement, a comparative paragraph, and clearly separated Args and Returns sections. It is appropriately sized for a tool with four parameters and a structured return value, with no wasted words.

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?

The description is complete for its complexity: it provides the tool's purpose, a contrast with siblings, all parameter semantics, and an explicit return format. Because there is no output schema, the detailed return object fills the gap and makes the tool's behavior predictable.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description fully compensates. It defines symbol as a function/class name, root as an absolute path, language as an optional restriction with auto-detection, and max_depth as the number of caller/callee levels with a default of 1. This is exactly what an agent needs.

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 opens with a specific verb+resource+method: 'Trace a function's callers and callees across a checked-out repo (AST)'. It also explicitly contrasts with dependency_impact, stating that dependency_impact lists references while this tool builds a directed call graph, making the purpose unmistakable.

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?

The description names dependency_impact as a complementary alternative and clarifies when to use this tool: 'to reason about a change's ripple effects'. It also states a key prerequisite ('point it at a LOCAL clone'), which is practical usage guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SurajKGoyal/myopic'

If you have feedback or need assistance with the MCP directory API, please join our Discord server