Skip to main content
Glama
Claude Free Code MCP

Claude Free Code MCP

by ImIpscanning

replace_exact

Destructive

Replace exactly one occurrence of text in a file with atomic writes and an undo snapshot to avoid unintended edits.

Instructions

Replace exactly one occurrence of text. Uses atomic write with undo snapshot.

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": {
      "file": "<file>",
      "search": "<search>",
      "replacement": "<replacement>"
    },
    "name": "replace_exact"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesRelative file
searchYesExact text to find
replacementYesNew text
expectedSha256NoOptional optimistic concurrency SHA-256

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.5/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, but the description adds genuinely new behavior: the write is atomic and an undo snapshot is taken. That tells the agent a failed operation won't leave a partial file and that recovery is possible, which is the key missing piece for a destructive tool. It does not say how to retrieve the snapshot or how conflicts surface.

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?

Two short sentences, the scope constraint is front-loaded, and every clause carries information. Nothing is padded or repeated from the schema.

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 destructive four-parameter write tool the description covers atomicity and undo well, but it omits the behavior of the core constraint: what happens when the search text appears zero times or more than once, and what error the agent should expect. With no output schema, the description is the only place that contract could be stated.

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 100%, so file, search, replacement, and expectedSha256 are already documented in the schema. The description adds no parameter-level detail, such as how the search text is matched or what the optional SHA-256 is compared against, so baseline 3 applies.

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?

"Replace exactly one occurrence of text" states a specific verb and scope constraint, which distinguishes it in spirit from a broad multi-line edit tool. It stops short of naming a sibling (such as preview_replace or edit_lines), so the differentiation must be inferred from the scope word "exactly one".

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

Usage Guidelines2/5

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

There is no explicit when-to-use or when-not-to-use statement, and no mention of preview_replace as a safe pre-check or edit_lines as the alternative for multi-occurrence or line-based changes. The single-occurrence constraint hints at routing but leaves the agent to infer it.

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