Skip to main content
Glama

Read a file

read
Read-onlyIdempotent

Fetches indexed file text around a passage, heading, or cursor, trims at paragraph or sentence ends, and enables forward/backward continuation with section links for citation.

Instructions

Read an indexed file's text around a passage or section, cut at paragraph or sentence ends. Continue with next (as at), or go back with prev (as at, with before). Sections start with a Markdown link line to cite them by.

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": {
      "file": "<file>"
    },
    "name": "read"
  }
}

Input Schema

NameRequiredDescriptionDefault
atNoWhere to start: a passage's `chunk` number ('812'), or a cursor from `next`/`prev` ('812:340'). Default: the file's start.
fileYesThe file's full path, the `file` from search or browse results.
afterNoCharacters to read from the starting point on.
beforeNoCharacters to read before the starting point.
sectionNoStart at this section instead, by heading: '§ 1599', 'Tenor'. Reads to the section's end (at most `after` characters).

Output Schema

NameRequiredDescriptionDefault
urlNoShows the starting point highlighted in the user's browser.
fileYes
nextNoWhere the text stops: pass as `at` to read on. None at the file's end.
pageNo
prevNoWhere the text starts: pass as `at` with `before` to read further back. None at the file's start.
textYesThe text. Each new section starts with a Markdown link line, '[heading](url)': copy it to cite that section.
typeYes
chunksYesChunks in the file.
sectionNoHeading path at the starting point.
modifiedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already cover readOnly, idempotent, non-destructive and closed-world, so the safety profile is settled. The description adds genuinely non-obvious behavior: text is trimmed to paragraph or sentence boundaries, back-reading requires `before`, section reads stop at the section end capped by `after`, and section headings are Markdown link lines usable for citation.

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?

Three short sentences, front-loaded with the core operation and followed by navigation and citation details; nothing is filler. The parenthetical cursor syntax ("Continue with `next` (as `at`)") is dense and takes a second read to parse.

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 values like the `next`/`prev` cursors need not be explained in prose. Combined with full parameter descriptions, the definition covers what an agent needs to call it correctly; only the choice against sibling tools is left unaddressed.

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%, so the per-parameter meanings are already documented, which sets the baseline at 3. The description does add a little cross-parameter logic (forward via `next`, backward via `prev` plus `before`) that the individual schema entries do not express together, but it stops short of explaining truncation or cursor edge cases.

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 names a specific verb and resource: reading an indexed file's text around a passage or section, with boundary behavior ("cut at paragraph or sentence ends"). That is clearly distinguishable from search/browse/open, though it never names a sibling explicitly to reinforce the contrast.

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 through the pagination workflow: how to continue forward and how to step backward with `before`. It never states when to prefer this over browse/open or when reading is not appropriate, so the agent must infer the routing decision.

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