Skip to main content
Glama

graph_query

Read-onlyIdempotent

Trace how named symbols relate in a dependency graph using natural language queries. Returns a subgraph with nodes, edges, and a Mermaid diagram for ad-hoc code exploration.

Instructions

Trace how named symbols relate in the dependency graph → returns subgraph + Mermaid diagram. Input is NATURAL LANGUAGE only — NOT SQL. Must contain symbol/class names (e.g. "How does AuthService reach Database?", "What depends on UserModel?", "trace the flow of LoginHandler"). SQL-shaped input (SELECT/FROM/WHERE/JOIN…) is rejected with VALIDATION_ERROR — there is no SQL endpoint for the index. Weakly-grounded anchors (single-word collisions with many symbols) are dropped via god-name filter. Use for ad-hoc graph exploration. For structured call graph use get_call_graph instead. Read-only. Returns JSON: { nodes, edges, mermaid, truncated? }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesNatural-language question about code relationships. SQL is not accepted — use symbol names, e.g. "what depends on UserModel".
depthNoMax traversal depth (default 3)
max_nodesNoMax nodes in result graph (default 100)
Behavior5/5

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

Annotations declare read-only, nondestructive, idempotent. The description adds that it is read-only and discloses rejection of SQL with VALIDATION_ERROR, weakly-grounded anchor filtering, and output format. 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 (4-5 sentences) with front-loaded purpose, followed by constraints, examples, error handling, usage guidance, and output format. Every sentence adds value.

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?

Covers purpose, input constraints, error conditions, output format, and alternative tool. No missing critical elements for this 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?

Schema coverage is 100% with detailed descriptions. The description adds context like natural language requirement and examples, but the schema already covers parameter meanings sufficiently. Baseline 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 clearly states the tool traces symbol relationships in the dependency graph and returns a subgraph with a Mermaid diagram. It uses a specific verb and resource, and contrasts with the sibling tool 'get_call_graph' for structured call graph exploration.

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?

Explicitly states when to use ('ad-hoc graph exploration') and when not to use ('for structured call graph use get_call_graph instead'). Also provides constraints on input format (natural language only, no SQL) and mentions rejection behavior.

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