Skip to main content
Glama

batch

Read-only

Run a short read-only JavaScript script over a repository to count usages, outline or filter files, and return a compact summary instead of many separate reads.

Instructions

Run a short read-only JS script over the repo to answer a question that would otherwise take many reads (count usages, outline every file, filter files by content). The script gets ctx.files(glob), ctx.read(path, start, end), ctx.outline(path), await ctx.grep(pattern), await ctx.gitStatus(). Return a compact summary, not raw file contents. It cannot write files or run commands.

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": {
      "code": "<code>"
    },
    "name": "batch"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesJS body (may use await/return) or async (ctx) => ...
rootNoSubdirectory of the workspace to work in (default: the workspace root).
timeout_msNoTime limit in ms (default 5000, max 30000).
allow_secretsNoInclude secret files. Only when the user asked.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, but the description adds real context: the exact sandbox API surface available inside the script (ctx.files, ctx.read, ctx.outline, ctx.grep, ctx.gitStatus) and the hard restriction that it cannot write files or run commands. It does not discuss failure modes or how errors surface, which keeps it from 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?

Three tight sentences, front-loaded with purpose, then the available API, then the output and restriction constraints. Nothing is repeated from the schema and no sentence is filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description correctly states the expected return shape, and it covers sandbox scope and restrictions for a code-execution tool. The main remaining gap is behavior on error or timeout, which an agent would need to know before relying on it.

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 meaning that the schema does not: it enumerates the ctx helpers the `code` body may call, which tells an agent how to author that parameter. The remaining parameters (root, timeout_ms, allow_secrets) are left entirely to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

A concrete verb and resource ('Run a short read-only JS script over the repo') with three example use cases that make the tool's shape unambiguous. It does not differentiate itself from the sibling names pack/ship, though those names alone convey nothing about their behavior.

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?

Explicitly states the triggering condition ('a question that would otherwise take many reads') and gives concrete examples (count usages, outline every file, filter by content), plus a rule for the result ('return a compact summary, not raw file contents'). It stops short of naming alternatives or stating when not to use it, aside from the note that it cannot write files or run commands.

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

Deploy Server

Other Tools