Skip to main content
Glama

read_multiple_files

Read up to 20 files in one call, with optional line ranges or pattern search. Individual file errors don't block others, and full metadata is recorded so edits pass strict mode without re-reading.

Instructions

Read up to 20 files in a single call. Each file's content is returned under a '### ' heading, followed by that file's own read_file header (mtime, sha256, line and byte counts) so it can be edited without re-reading — reads ARE recorded per file, exactly like read_file, so edit_file works under [edits] strict mode with no re-read. Errors for individual files are reported inline — one unreadable file doesn't block the others. Accepts absolute paths, file:// URIs, or workspace-relative paths. Binary files are detected and skipped. Each file is subject to the same 200 KiB cap as read_file. Pass start_line/end_line or pattern (with use_regex/context_lines/max_matches) to slice or search EVERY path in the call uniformly — same semantics as read_file's own parameters, applied per file; there is no per-path override, so a windowed batch read still records EACH file's full mtime/sha in the read tracker (identical to read_file's own ranged-read behaviour — strict mode is mtime-based, not range-based, so a later edit anywhere in the file is still covered). The 20-path cap is unchanged by slicing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathsNoAbsolute paths, file:// URIs, or workspace-relative paths of files to read.
patternNoSearch EVERY path in this call for this pattern instead of returning a window — same semantics as read_file's pattern (literal by default, smart-case, Go RE2 regex when use_regex). Combine with start_line/end_line to restrict the search to that line window in every file.
end_lineNoLast line to return (1-based, inclusive) from EVERY path in this call. Omit to read to the end of each file.
use_regexNoTreat pattern as a Go RE2 regular expression. Only consulted when pattern is set.
start_lineNoFirst line to return (1-based, inclusive) from EVERY path in this call — same semantics as read_file's start_line, applied uniformly. Omit to start from the beginning of each file.
max_matchesNoMaximum matching lines to return per file in search mode. Default 200. Only consulted when pattern is set.
context_linesNoLines of context around each match (like rg -C), applied to every path. Default 0. Only consulted when pattern is set.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed6 schema fields changedv0.17.0
    • addedInput schema / properties / context_lines
      Added value: +{
      +  "description": "Lines of context around each match (like rg -C), applied to every path. Default 0. Only consulted when pattern is set.",
      +  "maximum": 50,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / end_line
      Added value: +{
      +  "description": "Last line to return (1-based, inclusive) from EVERY path in this call. Omit to read to the end of each file.",
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / max_matches
      Added value: +{
      +  "description": "Maximum matching lines to return per file in search mode. Default 200. Only consulted when pattern is set.",
      +  "maximum": 2000,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / pattern
      Added value: +{
      +  "description": "Search EVERY path in this call for this pattern instead of returning a window — same semantics as read_file's pattern (literal by default, smart-case, Go RE2 regex when use_regex). Combine with start_line/end_line to restrict the search to that line window in every file.",
      +  "type": "string"
      +}
    • addedInput schema / properties / start_line
      Added value: +{
      +  "description": "First line to return (1-based, inclusive) from EVERY path in this call — same semantics as read_file's start_line, applied uniformly. Omit to start from the beginning of each file.",
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / use_regex
      Added value: +{
      +  "default": false,
      +  "description": "Treat pattern as a Go RE2 regular expression. Only consulted when pattern is set.",
      +  "type": "boolean"
      +}
  2. First observedv0.16.6

TDQS

A4.5/5.0
Behavior5/5

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

No annotations are present, so the description carries the full burden. It thoroughly discloses important behaviors: reads per file are recorded, individual file errors do not block others, binary files are skipped, the 200 KiB cap applies, paths can be absolute/relative/URI, and strict mode coverage is based on mtime rather than ranges. This is exemplary for a tool missing structural annotations.

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

Conciseness3/5

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

The content is highly relevant and information-dense, but it is delivered as one large continuous block. Some important strict-mode concepts are explained more than once, which adds length without adding new value. The structure would be improved with bullets or labeled paragraphs for read behavior, search/slice behavior, and limitations.

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?

Given the tool's complexity and lack of an output schema, the description covers all relevant dimensions: path input forms, limits, error isolation, file header output, binary skipping, search syntax, defaults, and strict-mode compatibility. An agent has enough information to invoke and interpret the tool safely.

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 description coverage is 100%, giving a strong baseline. The description adds meaningful semantic nuance beyond the schema by clarifying uniform application, no per-path overrides, how slicing interacts with read tracking, and how pattern plus start_line/end_line interact. This is valuable but somewhat narrative, so a 4 is appropriate.

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 opens with a specific verb–resource statement: 'Read up to 20 files in a single call.' It also distinguishes itself from read_file by emphasizing batched reads, per-file headers, and cross-file parameter application, making its scope immediately identifiable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear context for when to use this tool — multiple files, edit_file under strict mode, and avoiding re-reads. It doesn't explicitly name alternatives such as search_in_files for broader search or read_file for single-file reads, but the intended use case is strongly implied and anchored to read_file semantics.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/plumbkit/plumb'

If you have feedback or need assistance with the MCP directory API, please join our Discord server