Skip to main content
Glama

batch_read

Batch read multiple files under a token budget, automatically returning unchanged files as cache hits, diffs for modifications, and full content for new files.

Instructions

Read multiple files under a token budget. Automatically cache-aware.

Use this to seed the cache, gather several files at once, or expand globs before search, similar, or grep. Prefer over repeated read calls.

Behavior (automatic — no configuration needed):

  • Unchanged files counted in summary.unchanged_count (path list in debug mode).

  • Modified files return diffs.

  • New files return full content.

  • Large files skipped once token budget is exhausted.

If a file is skipped for budget, use read with offset/limit or raise the budget.

Args: paths: Comma-separated paths, JSON array, or glob patterns. max_total_tokens: Token budget across the batch. priority: Optional paths to read first before the remaining files.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathsYes
max_total_tokensNo
priorityNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
truncatedNo
summaryNo
skippedNo
filesNo
Behavior5/5

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

Since no annotations are provided, the description fully explains behavior: unchanged files are counted, modified files return diffs, new files return full content, and large files skipped when budget exhausted. It also mentions automatic cache-awareness, which is a key behavioral trait.

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?

The description is well-structured with sections for purpose, usage, behavior, and arguments. It is not overly verbose, though the 'Behavior' section could be slightly more concise. Overall, it is efficient and front-loaded with the key purpose.

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 presence of an output schema (as per context signals), the description appropriately focuses on input parameters and behavior. It covers usage guidelines, behavioral traits, and parameter semantics thoroughly, making it complete for the tool's complexity and context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 3 parameters with 0% description coverage, but the description adds substantial meaning: it explains that `paths` can be comma-separated, JSON array, or glob patterns; `max_total_tokens` is the token budget across the batch; and `priority` specifies optional paths to read first. This significantly 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 the tool reads multiple files under a token budget and is cache-aware. It distinguishes itself from the sibling `read` tool by suggesting it be used over repeated `read` calls, and it lists use cases like seeding the cache or expanding globs before other operations.

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?

Explicitly states when to use: to seed the cache, gather several files, or expand globs before `search`, `similar`, or `grep`. Also states when not to use and alternatives: if a file is skipped due to budget, use `read` with `offset`/`limit` or raise the budget. This provides clear guidance for appropriate invocation.

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