Skip to main content
Glama

Edit a file

herdr_file_edit

Replace exact text in a file locally or on another machine; apply all edits atomically and require each match once to prevent partial changes.

Instructions

Replace exact text in a file here or on another machine. Each old must occur exactly once; edits must not overlap; all are made or none. On edit_failed, add context to make old unique.

Input Schema

NameRequiredDescriptionDefault
onNoAnother machine (see herdr_machines); default: this one.
cwdNoWorking directory. Default: the core's; on another machine, its home.
pathYesAbsolute, or from cwd.
editsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/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 so well: it discloses the uniqueness constraint on each `old`, non-overlap of edits, and the all-or-nothing atomicity guarantee. Gaps remain around what happens if the file is missing, encoding assumptions, and whether `new` may be empty to delete text.

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 short sentences with zero filler. Scope comes first, then the matching and atomicity constraints, then the failure remedy, which is the order an agent needs them.

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?

Covers the remote/local scope, the matching constraint, atomicity and error recovery, and there is no output schema to explain. Missing only edge-case behavior such as a nonexistent path, creating a file, or empty `new` for deletion, which an agent editing files will likely wonder about.

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 75%, and the description still adds real meaning beyond the schema: the `old`/`new` pair must match exactly once within the file, edits cannot overlap, and the failure remedy is to widen the `old` context. That is semantics the schema's bare string types do not convey.

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?

States a specific verb and resource: 'Replace exact text in a file here or on another machine.' That is concretely different from herdr_file_write, though the description never names the sibling to make the contrast explicit for an agent choosing between them.

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?

The description implies when this is the right tool (surgical replacement rather than whole-file write), and gives recovery guidance on edit_failed. But it never states when to prefer herdr_file_write or herdr_put, nor any preconditions such as the file needing to already exist.

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