Skip to main content
Glama

traverse_graph

Read-onlyIdempotent

Walk the dependency graph from a starting symbol or file using BFS/DFS, returning JSON with nodes, depths, and edge types. Enforces a token budget to limit response size.

Instructions

Walk the dependency graph from a starting symbol or file using BFS/DFS, with a hard token budget on the response. Use when you want a structured "what reaches this from N hops away?" answer without committing to the call-graph or impact-radius shape. Read-only. Returns JSON: { start, direction, nodes: [{ id, kind, name, depth, edge_type, in_degree }], total_visited, truncated_by_depth, truncated_by_nodes, truncated_by_budget }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
start_symbol_idNoSymbol ID to start from. Mutually exclusive with start_file_path.
start_file_pathNoFile path to start from. Mutually exclusive with start_symbol_id.
directionNoDirection of traversal (default outgoing — follow what the start node points to).
max_depthNoMaximum BFS depth (default 3).
max_nodesNoMaximum nodes to visit (default 100).
edge_typesNoRestrict the walk to these edge types (default: all).
token_budgetNoApproximate token cap on the response (default 4000).
Behavior5/5

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

Annotations already mark it as read-only and idempotent. The description adds significant value by specifying the exact JSON return format including truncation flags (truncated_by_depth, etc.), which is not in 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 highly efficient, front-loading the purpose in the first sentence, then usage, behavior, and output. Every sentence earns its place with no redundancy.

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?

Despite no output schema, the description fully specifies the return format including node details and truncation flags. Combined with annotations it provides complete guidance for a complex 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?

The input schema has 100% description coverage for all 7 parameters, so the description does not need to add more parameter details. It adds nothing beyond the schema, meeting the baseline of 3.

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 the tool walks a dependency graph from a starting point using BFS/DFS with a token budget. It explicitly distinguishes itself from related siblings like get_call_graph or get_change_impact by noting it avoids committing to a specific shape.

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 a clear 'Use when' scenario: needing a structured answer about what reaches a node from N hops. It does not explicitly list when not to use or name alternatives, but the context is sufficient for an agent.

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/nikolai-vysotskyi/trace-mcp'

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