Skip to main content
Glama

batch_read

Read multiple files in one batch under a shared token budget. Returns diffs for changed files and skips unchanged content, minimizing token usage.

Instructions

Read several files at once under a shared token budget.

The efficient way to seed the cache before search/grep, and cheaper than many single read calls. New files return full content, changed files return a diff, and files already in your context are reported as unchanged with no body. Smallest files are read first; once the budget is spent the rest are listed under skipped — recover them with read using offset/limit.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathsYesThe files to read — a comma-separated list, a JSON array, or glob patterns (expanded for you).
priorityNoOptional paths to read first, ahead of the remaining files.
max_total_tokensNoTotal token budget shared across the whole batch.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesNo
skippedNo
summaryNo
truncatedNo
Behavior5/5

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

Given no annotations, the description fully bears the burden of disclosing behavior. It details that the tool reads smallest files first, returns full content for new files, diffs for changed files, marks unchanged files with no body, and lists skipped files when budget is exhausted. It also suggests recovery with 'read' using offset/limit, providing comprehensive behavioral insight.

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?

The description is front-loaded with the core action, followed by efficiency rationale, then detailed behavior descriptions. Each sentence serves a purpose without redundancy; the structure is logical and easy to parse.

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 the presence of an output schema (which presumably covers return format), the description covers input behavior, edge cases (budget exhaustion, file states), and recovery options. It is sufficiently complete for an agent to understand and invoke the tool correctly.

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 100% schema coverage, baseline is 3. The description adds significant value by explaining that 'paths' accepts comma-separated lists, JSON arrays, or glob patterns (expanded), and clarifies that 'priority' reads those files first. This extra detail enhances understanding beyond 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?

The description clearly states that the tool reads multiple files simultaneously under a shared token budget. It distinguishes itself from sibling tools like 'read' (single file) and 'grep' (search), and mentions efficiency benefits for caching before search/grep.

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 explicitly positions batch_read as the efficient choice for seeding cache and cheaper than multiple read calls. It provides guidance on when to use it (for multiple files) and hints at alternatives for skipped files (individual read with offset/limit), though it lacks explicit 'when not to use' statements.

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

Install Server

Other Tools

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/CoderDayton/semantic-cache-mcp'

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