Skip to main content
Glama
Claude Free Code MCP

Claude Free Code MCP

by ImIpscanning

preview_replace

Read-only

Preview an exact-string replacement in a file before applying it to verify the search and replacement text without modifying the file.

Instructions

Preview a unique exact-string replacement without modifying the file.

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": "preview_replace"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesRelative file
searchYesExact original text
replacementYesReplacement text

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, and the description consistently reinforces that nothing is written. The word 'unique' hints that a non-unique match is a failure condition, but the description does not say whether that yields an error, and since there is no output schema it also does not say what the preview displays (diff, surrounding context, match count).

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?

A single twelve-word sentence with no filler, and the non-mutating guarantee is front-loaded where an agent will see it first.

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?

For a small three-parameter read-only tool with full schema coverage and clear annotations, this is close to sufficient. The one real omission is what the preview actually returns, which matters because no output schema exists to describe it.

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 all three parameters (file, search, replacement) are already documented. The description contributes one extra nuance — that the search string is matched exactly and must be unique — but gives no guidance on path format, escaping, or whitespace sensitivity beyond the schema.

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 pairs a specific verb ('Preview') with the resource ('a unique exact-string replacement') and adds the key scope qualifier 'without modifying the file.' It implicitly distinguishes itself from the write-path sibling replace_exact, but never names it, so the contrast must be inferred.

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?

'Preview ... without modifying the file' implies this is the safe pre-check before an actual replacement, but it never states when to use this versus replace_exact, or that replace_exact is the way to apply the change. Usage is suggested rather than prescribed.

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