Skip to main content
Glama
0xYubo
by 0xYubo

trace_callers

Read-only

Trace all callers of a function level by level, from direct callers up to 5 levels deep. Discover which code is affected when changing a function, with confidence indicators for each call.

Instructions

BFS 逐层找出调用指定函数的函数:depth=1 为直接调用者,depth=2 再找「调用者的调用者」,依此类推(上限 5 层)。适合回答「改了函数 X,影响会波及到哪里?」返回 {target, max_depth, total_found, truncated, levels:[{depth, callers:[{file, line, caller_function, callee, confidence}]}]}。confidence=high 表示 foo(x) 直呼;medium 表示 obj.foo() 按方法名匹配,可能是其他类的同名方法。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
depthNo追踪层数,1=直接调用者,最大 5,默认 1
max_resultsNo所有层合计最大返回数,默认 500
exclude_dirsNo排除目录,不传则使用默认排除列表,传 [] 则不排除任何目录
project_pathYesPython 项目根目录绝对路径
function_nameYes要追踪的函数名,如 'get_eq_partition'
Behavior4/5

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

Beyond the readOnlyHint annotation, the description discloses the BFS algorithm, depth limit of 5, the exact return structure, and the semantics of confidence levels (high vs medium). This is useful behavioral context, though it does not cover edge cases like function-not-found or exit conditions. No contradiction with annotations.

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 concise—just two dense sentences—yet packs in the algorithm, depth bounds, use case, return schema, and confidence interpretation. Every phrase contributes meaning, and the most important action (BFS caller tracing) is front-loaded.

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?

In the absence of an output schema, the description fully specifies the return structure with fields like target, max_depth, total_found, truncated, and levels with per-caller details. It also explains confidence granularity. Given the tool's moderate complexity, this is complete enough for an agent to understand what to expect.

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?

The schema description coverage is 100%, and the description adds little beyond the schema for parameters. It does clarify the depth semantics (depth=1 direct callers, depth=2 indirect callers) but this is also largely present in the schema's depth field. With full schema coverage, a baseline of 3 is appropriate.

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 uses a specific verb and resource: 'BFS 逐层找出调用指定函数的函数' (BFS layer-by-layer finds callers of the specified function). It clearly distinguishes itself from siblings like find_definition (which locates definitions) and analyze_python_ast (which analyzes AST), making the tool's unique 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 Guidelines4/5

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

The description explicitly states when to use the tool: '适合回答「改了函数 X,影响会波及到哪里?」' (suitable for answering 'If I change function X, where will the impact spread?'). This provides a clear use case, though it does not mention alternatives or exclusions compared to sibling tools.

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/0xYubo/Ripple-Mcp'

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