batch
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
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | JS body (may use await/return) or async (ctx) => ... | |
| root | No | Subdirectory of the workspace to work in (default: the workspace root). | |
| timeout_ms | No | Time limit in ms (default 5000, max 30000). | |
| allow_secrets | No | Include secret files. Only when the user asked. |