Skip to main content
Glama

multiread

Read multiple files in one call with encoding detection, per-file line ranges, and truncation metadata, reducing API round-trips and enabling resumable reads.

Instructions

Reads multiple files in a single call to reduce API round-trips. Encoding-aware: auto-detects each file, with optional global/per-file encoding overrides. Supports offset/limit for reading specific line ranges. Defaults to 200 lines per file and 32768 characters total across the call. Returns visible per-file and overall truncation metadata with continuation positions. Resume the same input list with start_file_index=next_file_index and resume_offset=next_offset (omit resume_offset when zero). Use file_paths or paths (string array) with global offset/limit, or files (object array) for per-file offset/limit. If a file fails, the error is included in output and remaining files continue. Maximum 50 files per request.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "multiread"
  }
}

Input Schema

NameRequiredDescriptionDefault
allNoRemove the default per-file line limit. The total character budget still applies. Default: false
filesNoPer-file read ranges. Each entry has path, offset, limit. Takes priority over file_paths
limitNoMaximum lines per file. Default: 200. Set 0 or all=true to remove the line limit
pathsNoCompatibility alias for file_paths; prefer file_paths
offsetNoLine number to start from (1-based, negative = from end). Default: 1
encodingNoDefault charset override, e.g. EUC-KR or CP949; files entries may override it; BOM takes priority
file_pathsNoFile paths to read. All files use the global offset/limit. Use files for per-file ranges
include_hashNoInclude per-file SHA-256 hashes. Default: false
resume_offsetNoOverride offset only for start_file_index; other files retain their original ranges
max_line_charsNoMaximum characters returned from one line. Default: 4000, Max: 32768
max_output_charsNoMaximum total returned text characters across all files. Default: 32768, Min: 256, Max: 131072
start_file_indexNoResume at this 1-based index in the original file list; default 1

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv1.0.5
    • addedInput schema / properties / encoding
      Added value: +{
      +  "description": "Default charset override, e.g. EUC-KR or CP949; files entries may override it; BOM takes priority",
      +  "type": "string"
      +}
    • addedInput schema / properties / files / items / properties / encoding
      Added value: +{
      +  "description": "Per-file charset override; otherwise inherits global encoding; BOM takes priority",
      +  "type": "string"
      +}
    • changedInput schema / properties / max_output_chars / description
      Previous value: -"Maximum total returned text characters across all files. Default: 32768, Max: 131072"New value: +"Maximum total returned text characters across all files. Default: 32768, Min: 256, Max: 131072"
    • addedInput schema / properties / resume_offset
      Added value: +{
      +  "description": "Override offset only for start_file_index; other files retain their original ranges",
      +  "type": [
      +    "null",
      +    "integer"
      +  ]
      +}
    • addedInput schema / properties / start_file_index
      Added value: +{
      +  "description": "Resume at this 1-based index in the original file list; default 1",
      +  "type": "integer"
      +}
  2. Changed14 schema fields changedv0.9.5
    • addedInput schema / properties / all
      Added value: +{
      +  "description": "Remove the default per-file line limit. The total character budget still applies. Default: false",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / file_paths / description
      Previous value: -"List of absolute file paths to read. All files use the global offset/limit. Use 'files' instead for per-file ranges"New value: +"File paths to read. All files use the global offset/limit. Use files for per-file ranges"
    • changedInput schema / properties / files / items / properties / limit / description
      Previous value: -"Max lines to read. Default: 0 (all)"New value: +"Max lines to read. Default: 200. Set 0 to remove the line limit"
    • addedInput schema / properties / files / items / properties / limit / type
      Added value: +[
      +  "null",
      +  "integer"
      +]
    • addedInput schema / properties / files / items / properties / offset / type
      Added value: +[
      +  "null",
      +  "integer"
      +]
    • changedInput schema / properties / files / items / properties / path / description
      Previous value: -"Absolute file path"New value: +"Absolute or workspace-relative file path"
    • addedInput schema / properties / include_hash
      Added value: +{
      +  "description": "Include per-file SHA-256 hashes. Default: false",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum number of lines to read per file. Default: 0 (all)"New value: +"Maximum lines per file. Default: 200. Set 0 or all=true to remove the line limit"
    • addedInput schema / properties / limit / type
      Added value: +[
      +  "null",
      +  "integer"
      +]
    • addedInput schema / properties / max_line_chars
      Added value: +{
      +  "description": "Maximum characters returned from one line. Default: 4000, Max: 32768",
      +  "type": "integer"
      +}
    • addedInput schema / properties / max_output_chars
      Added value: +{
      +  "description": "Maximum total returned text characters across all files. Default: 32768, Max: 131072",
      +  "type": "integer"
      +}
    • changedInput schema / properties / offset / description
      Previous value: -"Line number to start reading from (1-based). Negative = from end (e.g. -5 = last 5 lines). Default: 1"New value: +"Line number to start from (1-based, negative = from end). Default: 1"
    • addedInput schema / properties / offset / type
      Added value: +[
      +  "null",
      +  "integer"
      +]
    • changedInput schema / properties / paths / description
      Previous value: -"Alias for file_paths"New value: +"Compatibility alias for file_paths; prefer file_paths"
  3. Addedv0.8.7
  4. Removed
  5. Changed4 schema fields changedv0.7.12
    • changedInput schema / properties / file_paths / description
      Previous value: -"List of absolute file paths to read,required"New value: +"List of absolute file paths to read. All files use the global offset/limit. Use 'files' instead for per-file ranges"
    • addedInput schema / properties / files
      Added value: +{
      +  "description": "Per-file read ranges. Each entry has path, offset, limit. Takes priority over file_paths",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "limit": {
      +        "description": "Max lines to read. Default: 0 (all)",
      +        "type": "integer"
      +      },
      +      "offset": {
      +        "description": "Line offset (1-based, negative = from end). Default: 1",
      +        "type": "integer"
      +      },
      +      "path": {
      +        "description": "Absolute file path",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "path"
      +    ],
      +    "type": "object"
      +  },
      +  "type": [
      +    "null",
      +    "array"
      +  ]
      +}
    • removedInput schema / required
      Removed value: -[
      -  "file_paths"
      -]
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": false,
      -  "properties": {
      -    "content": {
      -      "type": "string"
      -    },
      -    "error_count": {
      -      "type": "integer"
      -    },
      -    "files_read": {
      -      "type": "integer"
      -    }
      -  },
      -  "required": [
      -    "content",
      -    "files_read",
      -    "error_count"
      -  ],
      -  "type": "object"
      -}New value: +null
  6. Addedv0.6.1

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so well: it discloses default budgets (200 lines/file, 32768 chars total), truncation metadata and continuation positions in the response, error isolation (a failed file reports its error while the rest continue), encoding precedence (BOM > per-file > global), and the 50-file cap. These are exactly the behavioral traits an agent needs before calling a bulk reader.

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?

Purpose is front-loaded in the first sentence and each subsequent line carries distinct information rather than restating the schema. The result is somewhat dense as a single block with several interacting concepts (resume, encoding, dual path parameters), which costs it the top score but there is no filler.

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?

For a 12-parameter, annotation-free bulk reader with no output schema, the description covers the response shape (truncation metadata, continuation offsets, per-file errors), all default budgets, and the resumption protocol. An agent can construct a correct call and correctly chain a follow-up call from the text alone.

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 baseline is 3, but the description adds real meaning beyond it: the precedence of `files` over `file_paths`, and the non-obvious pairing of `start_file_index` with `resume_offset` (omit it when zero, other files keep original ranges). It does not explain `all`, `include_hash`, or `max_line_chars`, but those are already self-documenting in the schema.

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+scope: reads multiple files in a single call to reduce API round-trips, which cleanly separates it from the single-file `read` sibling. The follow-up lines enumerate the distinguishing capabilities (encoding detection, offset/limit, truncation metadata) that make the tool's identity unambiguous.

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?

Gives clear operational context: when to pick `file_paths`/`paths` versus `files`, when to use `start_file_index`+`resume_offset` to continue a truncated read, and the 50-file ceiling. It never explicitly names the single-file `read` alternative or states when NOT to use this tool, so a 4 rather than a 5.

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