Skip to main content
Glama
isac322

pi-codegraph

by isac322

codegraph_node

Read-onlyIdempotent

Read indexed source files with line numbers and dependents, or inspect a symbol's source and relationships to understand code impact.

Instructions

Read an indexed file with line numbers and dependents, or inspect a named symbol with its source and relationships.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNoFile path or basename. Use it alone with codegraph_node to read a file, or with a symbol to select one definition.
lineNoLine used to disambiguate a symbol definition.
limitNoMaximum lines to return in file mode.
offsetNoOne-based starting line in file mode.
symbolNoSymbol name to inspect.
includeCodeNoInclude the symbol body in symbol mode.
projectPathNoAbsolute path to the target project or worktree. Pi fills this with the active cwd when omitted; OMP child agents should pass their exact worktree path.
symbolsOnlyNoReturn the file's symbol map instead of source.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.2

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnlyHint, idempotentHint, destructiveHint), so the description only needs to add behavioral context. It does add meaningful context: file mode returns line numbers and dependents, while symbol mode returns source and relationships. It does not describe output format or edge cases, but it goes beyond what annotations alone convey.

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?

One tightly constructed sentence with two parallel clauses, no filler, and the primary actions front-loaded. It earns its place and is easy for an agent to parse quickly.

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 an 8-parameter dual-mode tool with no output schema, the description is thin. It gives mode-level return expectations but omits output shape, relationship depth, and boundaries against sibling tools. The strong annotations and complete parameter schema carry much of the burden, so this is not severely incomplete, but it leaves meaningful gaps.

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%, and the parameter descriptions already document file/symbol mode selection, pagination, includeCode, projectPath, and symbolsOnly. The description adds no new parameter-level meaning beyond grouping the two usage modes, so the baseline of 3 is appropriate.

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?

The description states specific actions and resources: 'Read an indexed file with line numbers and dependents' and 'inspect a named symbol with its source and relationships.' It clearly expresses the dual-mode nature of the tool, but it does not explicitly distinguish it from relationship-focused siblings like codegraph_callers or codegraph_callees.

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 description gives practical mode-level guidance (use file mode to read a file, symbol mode to inspect a symbol), but it never names alternatives or states when not to use this tool. The mention of 'dependents' and 'relationships' could lead an agent to pick this tool over more specific sibling tools such as codegraph_callers or codegraph_impact.

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