Skip to main content
Glama

Read files the index named (several at once)

read
Read-only

Fetch numbered lines from multiple indexed files in one call, with optional line ranges and pagination, after find, search, or sql identifies targets.

Instructions

The numbered lines of the files named - several files in one call, from the index, each line as path:line. Use it after find, search or sql have named the files you want, for every file at once, in place of one Read per file. from and to cut every file to a line range; lists in both name several ranges in one call, paired in order (from [559, 1938], to [610, 1975] reads 559-610 and 1938-1975), for the windows around several places in a file - never one read per range. A file over 400 lines, or past the result's budget, comes back a page at a time, with more saying where its next page starts, and the result's next lists the read calls that fetch the rest of every file cut short - make them, all in one reply. A path the index does not hold comes back as a miss beside the others. The result includes a 'usage' field, a one-line receipt of tokens returned and files.

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

Input Schema

NameRequiredDescriptionDefault
toNoLast line to return, in every file named - or a list, one per range, paired with from. Default the end.
fromNoFirst line to return, in every file named - or a list, one per range, paired with to. Default 1.
pathNoAbsolute path to the repository root to read from. Defaults to the server's configured root; set it to target a specific repo when a session spans more than one.
pathsYesRepo-relative paths, as find, search and sql cite them - every file you want, in one call.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.6.0

TDQS

A4.7/5.0
Behavior5/5

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

Beyond readOnlyHint=true it discloses non-obvious runtime behavior: files over 400 lines or past the result budget are paged, a "more" field marks the next page start, and a result "next" field lists follow-up calls the agent should make in one reply. It also states that unknown paths come back as a miss alongside successful reads and that a "usage" receipt is included — none of which the annotations convey.

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?

Front-loaded with the core purpose and the batched-read framing, and nearly every clause carries information about paging, pairing, or misses. The single dense paragraph has some run-on phrasing ("The numbered lines of the files named") that costs a little immediate readability.

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 no output schema, the description compensates well by describing the return shape (path:line lines, "more", "next", "usage", miss entries) and the paging protocol. Minor gaps remain: the max-16 paths limit and the purpose of the `path` repo-root override are never mentioned in prose.

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 schema baseline already carries the parameters; the description still adds value by explaining array pairing concretely ("from [559, 1938], to [610, 1975] reads 559-610 and 1938-1975"). It omits the 16-path cap and the repo-root `path` override, which remain schema-only.

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?

States a specific verb and resource: returns the numbered lines of named files, several per call, each line formatted as path:line. It also distinguishes itself from the one-file-per-call alternative ("in place of one Read per file") and from siblings by naming find, search and sql as the tools that produce the paths it consumes.

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?

Gives explicit timing ("Use it after find, search or sql have named the files you want") and an explicit exclusion ("never one read per range", "for every file at once, in place of one Read per file"). The condition that selects this tool over repeated single reads is unambiguous.

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