Skip to main content
Glama

document_read_around

Read-onlyIdempotent

Read the verbatim text surrounding a search match, including configurable before and after units, so you can inspect context without losing the match or its cursor.

Instructions

Verbatim text around a search match: the match's units plus before/after units (defaults: 1 page, 3 paragraphs, 15 lines). The match is always inside the excerpt; anything left out on either side is stated with a cursor. [docbridge schema 0.2.4]

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
afterNo
beforeNo
encodingNoText encoding of a .md/.txt input. Omit for UTF-8; docbridge never guesses.
match_idYes
max_charsNoMost characters returned; a cut is always stated, with a cursor to continue.
input_pathYesAbsolute file path.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
toolYes
errorNo
matchNo
sourceNo
excerptNo
invariantNodocbridge may reduce the volume of its own responses, but it never alters, summarizes, paraphrases, semantically filters, or silently truncates source evidence
truncatedNoTrue if anything in the requested range was not returned.
next_cursorNoPass as `cursor` to document_read to continue exactly.
before_cursorNo
schema_versionYes
remaining_charsNoCharacters of the requested range after the excerpt.
requested_unitsNo
unreadable_unitsNoUnreadable units inside this excerpt.
operation_completedYes
omitted_before_charsNo
range_unreadable_unitsNoEvery unreadable unit of the whole requested range, returned or not.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.4

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, non-destructive behavior, yet the description adds real value beyond them: the match is guaranteed to be inside the excerpt, any omitted text is reported with a cursor, and cuts from max_chars are always stated. That is substantive behavioral context not available from annotations or 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?

Two tight sentences, front-loaded with the core behavior and cursor semantics; the bracketed schema version tag is minor noise but the rest earns its place.

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?

An output schema exists so return structure need not be explained, and the description covers the excerpt guarantee and truncation/cursor behavior. Remaining gap is the precise meaning of a 'unit' for the before/after parameters, which matters given a 6-parameter tool.

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 50% and before/after have no schema descriptions, so the description carries the load by giving their unit-relative defaults (1 page, 3 paragraphs, 15 lines) and confirming the match is always included regardless. It does not explain what a 'unit' resolves to per document type, leaving some ambiguity.

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?

States a specific verb and resource ('Verbatim text around a search match') and makes the scope precise by requiring a match_id, which implicitly distinguishes it from document_read/document_search. It does not name a sibling explicitly, so it stops short of a 5.

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 by the required match_id and the 'around a search match' framing — it clearly follows a search — but there is no explicit when-to-use vs. document_read or document_search, and no when-not guidance.

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