Skip to main content
Glama

read

Read-only

Fetch exact source code for one or more graph nodes by name, sliced from files by line spans. Use after find or impact to inspect code without grepping; comma-separate nodes to batch.

Instructions

Return the source code for one or more nodes, sliced from their files by the graph's line spans. Use after find/impact to read the exact code without grepping — comma-separate several node names to read the whole ranked set in a single call. Each node is a code block headed by its qname and path:start-end, plus a context: footer with structural facts the source alone doesn't show: HTTP method, cross-stack callers (or, on a WS / gRPC / GraphQL / tRPC client, the host it dials), covering tests, and intent/decision/constraint cells when present.

Input Schema

NameRequiredDescriptionDefault
nodeYesNode name or qname to read. Comma-separate several (e.g. the top-ranked nodes from `find`/`impact`) to slice them all in one call.
budgetNoMax chars in the result (shared across all nodes when several are given). 0 = no cap.
context_linesNoLines of padding above and below the node's span. Default 0.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.4.20
    • changedInput schema / properties / budget / description
      Previous value: -"Max chars in the result. 0 = no cap."New value: +"Max chars in the result (shared across all nodes when several are given). 0 = no cap."
    • changedInput schema / properties / node / description
      Previous value: -"Node name or qname to read the source for."New value: +"Node name or qname to read. Comma-separate several (e.g. the top-ranked nodes from `find`/`impact`) to slice them all in one call."
  2. Addedv0.4.19

TDQS

A4.5/5.0
Behavior4/5

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

The readOnlyHint annotation already settles the safety profile, so the description adds value by disclosing the shape of the operation: slicing by the graph's line spans, one block per node with qname and `path:start-end`, plus a `context:` footer carrying structural facts (HTTP method, cross-stack callers, covering tests, decision cells). That exceeds the annotation, though return-format detail partly overlaps the output schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose is front-loaded in the first clause, and the remaining sentences each add a distinct fact (batching idiom, output block anatomy, context footer contents). It is dense and slightly long, but no sentence is filler; the trailing list of context-footer facts is the only place it drifts toward enumeration.

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?

With an output schema present, explaining return values is optional, yet the description still covers the operation, its sequencing, and its batching behavior, so an agent has what it needs to call it correctly. Minor omissions (error behavior when a node name is unresolvable, how budget truncation is signaled) are not material.

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?

Schema coverage is 100%, so the baseline is 3, but the description adds rationale the schema lacks — that comma-separating node names lets the agent read the entire ranked set in a single call, and that budget is shared across all requested nodes. The `context_lines` semantics are already fully carried by the schema.

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 states a specific verb and resource — return source code for one or more nodes, sliced by graph line spans — and explicitly positions it in a workflow with `find`/`impact`. An agent can distinguish it from `find`, `impact`, `orient`, and `trace` without opening any schema.

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?

It names the sequencing condition explicitly ('Use after `find`/`impact`') and names the alternative it replaces ('without grepping'), plus explains the multi-node batching idiom so the agent knows to pass the whole ranked set in one call. This is precisely the when/alternative guidance the dimension asks for.

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

Deploy Server

Other Tools