Skip to main content
Glama

trace_calls

Find all callers or callees of a function and return a call tree to analyze code dependencies. Set direction and depth to focus the trace.

Instructions

Find all callers (who calls this?) or callees (what does this call?) of a function. Returns a call tree.

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_name": "<function_name>"
    },
    "name": "trace_calls"
  }
}

Input Schema

NameRequiredDescriptionDefault
depthNoMax traversal depth (1-5)
projectNoProject namedefault
directionNoinbound=callers, outbound=callees, both=allboth
function_nameYesFunction or method name to trace

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.1.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description must carry behavioral disclosure. It does state the return is a call tree, which is genuinely useful, but says nothing about read-only nature, result size, truncation at depth limits, or whether unresolved symbols cause errors.

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?

Two short sentences, front-loaded with the core action and immediately clarifying the directional ambiguity. No wasted verbiage.

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?

For a 4-parameter traversal tool with no annotations and no output schema, the description covers purpose and return shape but omits prerequisites (must the project be indexed?) and result-size expectations, which an agent needs before calling.

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 direction, depth (1-5 cap), and project defaults are already documented. The description reinforces the direction semantics but adds nothing about depth cost or behavior.

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+resource (trace a function's callers/callees) and explains the two directions with concrete parentheticals. It's clear what the tool does, but it doesn't differentiate itself from graph/query siblings like query_graph or get_symbol_info.

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

Usage Guidelines3/5

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

The parentheticals 'who calls this?' and 'what does this call?' imply when each direction applies, but there's no explicit when-to-use guidance and no named alternative such as query_graph for general graph traversal.

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