Skip to main content
Glama

Read Files

read_files
Read-only

Read up to 20 files in ONE call, much cheaper than repeated read_file: prefer it whenever you need several files together (an endpoint, its .schema.ts and the hook that calls it). Same paths and options as read_file (diagnostics, include_references; /_cdn/ images come back as images), each file cat -n style under a header. Output is capped: whole files at the end are left out and listed by name. With older_than (up to 5 paths) the files are walked back through history TOGETHER on one timeline — the way to keep a component and its stylesheet consistent.

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

Input Schema

NameRequiredDescriptionDefault
limitNo
pathsYes
projectIdYes
older_thanNoOmit (or leave empty) to read the current file. Set it only to read the file as it was BEFORE an earlier change. Pass "current" for the version just before the latest change to it, then the cursor each result gives you to step one change further back — until you find a good version, then write it back with write_file (or merge by hand). Not a version number: each step is one recorded change to the file. Type errors and references are skipped for past versions.
diagnosticsNo
include_referencesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / older_than / description
      Previous value: -"Read the file as it was BEFORE an earlier change instead of the current file. Pass \"current\" for the version just before the latest change to it, then the cursor each result gives you to step one change further back — until you find a good version, then write it back with write_file (or merge by hand). Not a version number: each step is one recorded change to the file. Type errors and references are skipped for past versions."New value: +"Omit (or leave empty) to read the current file. Set it only to read the file as it was BEFORE an earlier change. Pass \"current\" for the version just before the latest change to it, then the cursor each result gives you to step one change further back — until you find a good version, then write it back with write_file (or merge by hand). Not a version number: each step is one recorded change to the file. Type errors and references are skipped for past versions."
  2. Changed1 schema field changed
    • addedInput schema / properties / older_than
      Added value: +{
      +  "description": "Read the file as it was BEFORE an earlier change instead of the current file. Pass \"current\" for the version just before the latest change to it, then the cursor each result gives you to step one change further back — until you find a good version, then write it back with write_file (or merge by hand). Not a version number: each step is one recorded change to the file. Type errors and references are skipped for past versions.",
      +  "type": "string"
      +}
  3. Changed1 schema field changed
    • addedInput schema / properties / include_references
      Added value: +{
      +  "type": "boolean"
      +}
  4. First observed

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, non-destructive, closed-world), but the description adds genuinely non-obvious behavior: output is capped and trailing files are silently omitted and listed by name, image paths come back as images rather than text, and content is rendered cat -n style under headers. It does not disclose project scoping or any access/permission constraints, which keeps it below a 5.

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

Conciseness5/5

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

Front-loads the core value proposition in the first clause, then layers cost, options, output shape, and the history mode. Dense but every sentence adds a distinct fact, with no restatement of the title or annotations.

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?

There is no output schema, so the description takes on return-value disclosure itself and does so: headers, cat -n formatting, image passthrough, and truncation semantics. Combined with the option parity to read_file and the older_than workflow, an agent has enough to invoke it correctly on the first attempt.

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 schema description coverage at only 17%, the description carries most of the load: it establishes the 20-path cap on paths, explains that diagnostics and include_references mirror read_file, and gives real semantics for older_than (walk back one recorded change at a time, 'current' as the entry point, cursor stepping, skipped diagnostics for past versions, up to 5 paths on one timeline). It leaves limit and projectId unexplained, so it does not fully compensate for the coverage gap.

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?

Opens with a specific verb, resource, and quantity bound ('Read up to 20 files in ONE call'), and explicitly positions itself against the sibling read_file by claiming the batch case. An agent can distinguish it from read_file and list_files without opening either schema.

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 an explicit prefer-when rule ('prefer it whenever you need several files together') with a concrete example set (an endpoint, its .schema.ts, the hook calling it), plus a second use case for older_than ('the way to keep a component and its stylesheet consistent'). The alternative, repeated read_file, is named as the thing being replaced.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources