Skip to main content
Glama

map_files

Apply one instruction across many files with a local model, returning per-file reports or staged diffs that stay off disk until committed.

Instructions

Run one instruction over many files with the local model (batch job). output='report': get per-file results. output='stage_writes': the model rewrites each file and every change is staged as a diff for your review — NOTHING hits disk until you commit_write.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
globYesGlob pattern, e.g. 'src/**/*.test.ts'
seedNoFixed seed for reproducible output.
stopNoStop sequences.
modelNo
thinkNoChain-of-thought control (ollama `think`; best-effort on openai-compatible servers). think:false keeps the whole max_tokens budget for the answer.
top_pNoNucleus sampling threshold.
outputNoreport
num_ctxNo
optionsNoProvider-native overrides merged into the request (ollama `options` keys like top_k/repeat_penalty; openai-compatible body fields). Wins over named params.
providerNo
max_filesNo
concurrencyNoParallel local-LLM requests (default 2)
instructionYesInstruction applied to each file. For stage_writes the model must return the COMPLETE new file content.
temperatureNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well on the critical dimension: it explicitly states that stage_writes produces a staged diff and 'NOTHING hits disk until you commit_write', which is exactly the kind of safety/mutation context an agent needs. It is silent on other traits: batch size limits, ordering, failure handling per file, and the cost/latency of running a local model over many files.

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 with zero filler: the batch operation is front-loaded, then the two output modes are enumerated with the safety note attached to the riskier one. No restatement of the tool name or schema content for its own sake.

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

Completeness3/5

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

For a 14-parameter tool with no annotations and no output schema, the description covers the decisive choices (mode selection and the staging guarantee) but skips return shape for report mode beyond 'per-file results', default concurrency/model behavior, and any limits. Adequate to call it, not sufficient to predict its behavior or output.

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

Parameters3/5

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

Schema description coverage is 57%, so some parameters (glob, seed, stop, think, options, concurrency, instruction) are already documented in the schema. The description adds genuine meaning for the undocumented 'output' enum pair and reinforces the instruction contract for stage_writes. But high-impact parameters such as model, provider, num_ctx, max_files, and temperature remain unexplained in both places.

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?

The description states a concrete verb+resource: 'Run one instruction over many files with the local model (batch job)', and clarifies scope with the parenthetical 'batch job'. It distinguishes the two output modes, but does not contrast itself with adjacent siblings such as propose_edit, run_local_agent, or extract, which an agent may weigh for similar work.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives real selection guidance between the two output values (report vs stage_writes) and names the downstream commit_write step, which is the key routing decision. However, it never says when to prefer map_files over sibling tools like propose_write/propose_edit or run_local_agent, so the broader when-to-use question is left to inference.

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