Skip to main content
Glama

call_hierarchy

Reveal a symbol's call hierarchy: inspect incoming callers, outgoing callees, or both to understand control flow and assess the impact of code changes.

Instructions

Show the call hierarchy for a symbol: who calls it (incoming) and what it calls (outgoing). PREFER a name (uri + symbol_name) — plumb resolves the exact identifier position for you, avoiding off-by-one errors; a raw file position (uri + line + character) is the fallback and, when it lands off an identifier, is snapped to the enclosing symbol. Useful for understanding control flow and assessing the impact of changes. When the language server provides no call hierarchy for the file (e.g. zls for Zig), falls back to the topology call graph, annotated source=topology (approximate).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uriNoAbsolute path, file:// URI, or workspace-relative path containing the symbol
lineNoZero-based line number of the symbol. Required when symbol_name is not provided.
characterNoZero-based character offset within the line. Required when symbol_name is not provided.
directionNoWhich call direction to return: callers (incoming), callees (outgoing), or both. Defaults to both.
symbol_nameNoSymbol name to look up instead of a position — PREFERRED over line/character. Accepts plain name or ReceiverType.MethodName form. plumb resolves it against the file's symbols, avoiding the off-by-one and 'no identifier found' errors of a hand-computed position. When provided, line and character are not needed.
Behavior4/5

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

With no annotations, the description carries full burden and does well: it discloses the fallback to topology, marks it as 'approximate', explains the snapping behavior when a raw position lands off an identifier, and warns about off-by-one errors. No contradictions with annotations. Minor gap: no mention of return shape or pagination, but the key behaviors are transparent.

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 yet information-dense. It front-loads the core purpose, then layers usage guidance, input preferences, and fallback behavior in a logical order. Every sentence adds value, and there is no fluff or redundancy.

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

Completeness4/5

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

Given the tool's complexity (two input modes, direction enum, fallback path), the description covers the essential aspects: what it does, preferred vs. fallback input, fallback to topology, and a use case. It does not describe the output structure (e.g., tree format), but in the absence of an output schema, this is a minor omission for a hierarchy tool.

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?

Even though schema coverage is 100%, the description adds meaningful semantics: it explains why symbol_name is preferred (avoids off-by-one and 'no identifier found' errors), describes the ReceiverType.MethodName form, and clarifies that line/character are unnecessary when symbol_name is provided. This goes beyond the schema's basic descriptions.

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 'Show the call hierarchy for a symbol: who calls it (incoming) and what it calls (outgoing)', using a specific verb and resource with scope. It distinguishes from siblings like find_references and type_hierarchy by explicitly naming the call direction and fallback behavior.

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?

It provides clear context: 'Useful for understanding control flow and assessing the impact of changes.' It also explains when the topology fallback applies (e.g., zls for Zig) and prescribes preferred input over fallback. However, it does not explicitly contrast with alternative tools like find_references, so it stops short of full when/when-not 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/plumbkit/plumb'

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