Skip to main content
Glama

multiread

Read multiple files in one call to cut down API round-trips. Auto-detects encoding, supports custom line ranges, and includes per-file error handling.

Instructions

Reads multiple files in a single call to reduce API round-trips. Encoding-aware: auto-detects file encoding for each file. 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. 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.

Input Schema

TableJSON 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
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
max_line_charsNoMaximum characters returned from one line. Default: 4000, Max: 32768
max_output_charsNoMaximum total returned text characters across all files. Default: 32768, Max: 131072

Schema Changelog

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

  1. 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"
  2. Addedv0.8.7
  3. Removed
  4. 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
  5. Addedv0.6.1

TDQS

A4.7/5.0
Behavior5/5

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

No annotations exist, so the description carries the full behavioral burden. It discloses encoding auto-detection, default line and character budgets, truncation metadata with continuation positions, per-file error isolation, and the 50-file cap. This is unusually transparent for a tool with no annotation support.

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?

Every sentence contributes a distinct behavior or usage constraint: purpose, encoding, line/character limits, per-file modes, failure handling, and max file count. It is dense but not bloated, and the most important fact is front-loaded.

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 tool with 9 parameters, no annotations, and no output schema, the description is remarkably complete. It covers defaults, limits, semantics, file failure handling, encoding behavior, and truncation continuation positions, leaving an agent with the practical knowledge needed to invoke it and interpret its results.

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?

The input schema already covers 100% of parameters, so the baseline is 3. The description adds value by tying parameters to usage modes: global offset/limit vs per-file files entries, the interaction of all=true with the total character budget, and the 50-file request cap not visible in the schema. These aggregates help an agent pick the right parameter shape.

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 and resource: 'Reads multiple files in a single call to reduce API round-trips.' This immediately distinguishes it from the single-file 'read' sibling and clearly states the batching purpose.

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 provides strong contextual guidance: use the tool for reading multiple files efficiently, choose global file_paths/paths vs per-file files objects depending on offset/limit needs, and understand failure/encoding/limit behavior. It does not explicitly name the single-file 'read' tool as the alternative, but the multiple-vs-single distinction is clear.

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/knewstimek/agent-tool'

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