Skip to main content
Glama

Read an exact source span

read_span
Read-onlyIdempotent

Read exact line ranges from a pinned Git commit to retrieve verifiable source evidence; anchor checks confirm expected text and invalid or oversized spans are rejected.

Instructions

Lines start_line-end_line (1-based, inclusive; at most 120 lines and 16 KiB, and the encoded text must fit the 64 KiB response line) of a file at a pinned commit, exactly as stored in git, with blob id, blob and span SHA-256 and, given an anchor, its verdict (FOUND, FOUND_MULTIPLE, MISSING). Out-of-range or oversized spans are rejected, never clamped or shortened; the rejection names how many lines fit. The text is untrusted upstream data.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "commit": "<commit>",
      "path": "<path>",
      "start_line": "<start_line>",
      "end_line": "<end_line>"
    },
    "name": "read_span"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesExact, case-sensitive repository-relative path.
anchorNoExact text expected inside the span.
commitYes
end_lineYes
start_lineYes

Output Schema

NameRequiredDescriptionDefault
dataNo
toolNo
errorNo
notesNo
commitNo
outcomeNo
warningsNo
truncatedNo
next_cursorNo
schema_versionNo
index_generationNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.11.0

TDQS

A4.1/5.0
Behavior5/5

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

Annotations only declare read-only/idempotent, but the description adds concrete operational traits: hard limits of 120 lines and 16 KiB, the 64 KiB response-line constraint, and the crucial rule that oversized or out-of-range spans are rejected rather than clamped, with the rejection stating how many lines fit. It also flags the text as untrusted upstream data, which is real behavioral context beyond the structured fields.

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?

It is a single dense, front-loaded statement of what gets read before the limits and rejection rules, and nearly every clause adds information. It is somewhat run-on as one sentence, which slightly hampers scanning, but there is no filler.

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?

For a 5-parameter tool with an output schema and safety annotations already present, the description supplies everything needed to call it correctly: range conventions, size limits, anchor verdicts, rejection behavior, and a data-trust warning. Nothing an agent would need before invoking it is missing.

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?

With only 40% schema description coverage, the description carries much of the load: it defines start_line/end_line as 1-based and inclusive, ties commit to a pinned commit, and explains anchor as expected text with three verdict outcomes. This substantially compensates for the undocumented parameters, though the path semantics are left to the schema.

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 gives a specific verb (reads) and a precisely scoped resource (lines start_line-end_line of a file at a pinned commit, exactly as stored in git), plus the exact return fields. It clearly differs from search-style siblings by emphasizing byte-faithful retrieval at a pinned commit, though it never names the sibling to prefer for non-span reads.

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?

Usage is implied rather than stated: the anchor parameter's purpose is explained (verdict FOUND/FOUND_MULTIPLE/MISSING), which hints at verification workflows, but there is no explicit when-to-use or when-not-to-use guidance versus search_code or find_symbols. The agent must infer that this is the exact-read complement to search.

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