Skip to main content
Glama

trace_calls

Trace call chains from or to any function, following direct calls and cross-process invocations to map dependencies and callers.

Instructions

Trace call chains from or to a function/method, following CALLS and CALLS_REMOTE edges transitively.

Use this when you need to:

  • "What does this function eventually call?" (forward) — full call tree including cross-language hops

  • "Who calls this function?" (backward) — all callers up the stack

  • "Show the full call chain from handler to database" (forward with depth)

Unlike trace_dataflow (which follows data assignments), this follows function CALLS edges:

  • CALLS: same-language function/method invocation

  • CALLS_REMOTE: cross-process/language boundary (IPC, HTTP, socket)

Returns: Indented call tree showing each hop with file:line location.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceYesFunction/method name or semantic ID to trace from
fileNoFile path to disambiguate (optional)
directionNoforward (callees), backward (callers), or both (default: forward)
max_depthNoMaximum chain depth (default: 10)
Behavior4/5

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

No annotations provided, so description carries full burden. It discloses that it follows CALLS and CALLS_REMOTE edges and returns an indented call tree with file:line locations. Missing details like performance limits or side effects, but sufficient.

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?

Description is well-structured with bullet points and examples, front-loading core purpose. Slightly verbose but every sentence adds value; 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?

No output schema provided, but description explains return format (indented call tree with locations). Covers main use cases thoroughly for a 4-param tool.

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 coverage is 100% and schema already describes parameters well. Description adds context for direction and max_depth implicitly but does not add per-parameter details beyond schema.

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 clearly states that the tool traces call chains following CALLS and CALLS_REMOTE edges, distinguishing it from sibling tool `trace_dataflow` which follows data assignments.

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 provides explicit when-to-use scenarios (forward, backward, both) with examples and clarifies when not to use it by contrasting with `trace_dataflow`.

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/Disentinel/grafema'

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