Skip to main content
Glama

arno.replace_text

Destructive

Replace an exact string that appears once in a file. If the text is missing or duplicated, the edit is refused—extend it with surrounding context to target a single match.

Instructions

Replace an exact, unique string in a file. An anchor string does not move when the lines around it do, which is why follow-up edits address text rather than line numbers. Refuses when the anchor is absent or matches more than once — extend it with surrounding context to disambiguate. For several sites, use apply: atomic, one validation, no diagnostics from half-done intermediate states.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFile path to edit.
newTextYesReplacement text.
oldTextYesExact text to replace. Must appear exactly once.
expectedDigestNoOptional. The digest from the read this edit is based on; the edit is refused if the file changed since, by anyone.
expectedRevisionNoRevision expected before editing.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.0.12

TDQS

A4.6/5.0
Behavior4/5

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

Beyond destructiveHint=true, the description adds concrete refusal behavior when the anchor is absent or ambiguous, and explains why text anchors are stable across line changes. It does not state what a successful call returns, and the atomicity note is framed as apply's property rather than this tool's.

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?

Every sentence earns its place: purpose, behavioral rationale, refusal conditions, and routing to apply. It is compact but not bloated, with the core constraint stated up front.

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?

It covers selection and invocation thoroughly: purpose, uniqueness constraints, failure modes, and major alternative. The only gap is that no output schema exists and the description does not mention what a successful edit returns, which could matter for chaining follow-up edits via expectedDigest or expectedRevision.

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 real semantics for oldText by introducing the 'anchor' concept, the uniqueness requirement, and disambiguation guidance. The expectedDigest and expectedRevision parameters are already well documented in 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 first sentence names a specific operation, 'Replace an exact, unique string in a file', and the uniqueness qualifier makes the scope clear. It is also distinguished from arno.apply for multiple sites, so an agent can tell which tool applies.

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?

It explicitly states when this tool is appropriate, how to react to refusal by extending the anchor with context, and where not to use it: 'For several sites, use apply'. This gives clear selection guidance against a sibling.

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