Skip to main content
Glama
finch-shell-mcp
by hlint

Replace exact text

fs_patch
Destructive

Replace exact literal text, not regex, in a file using old/new text pairs with required match counts, and reject files over 8 MB.

Instructions

Replace exact text, not a regular expression. Each edit has old_text, new_text, and count, and count must equal the number of matches. Files over 8 MB are rejected.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "fs_patch"
  }
}

Input Schema

NameRequiredDescriptionDefault
bomNobom
pathNopath
editsNoReplacements in order. Each item is old_text, new_text, and count
encodingNoencoding
expect_hashNoexpect_hash

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A3.6/5.0
Behavior4/5

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

Annotations only declare destructiveHint=true; the description adds real behavioral context beyond that: count must match the number of occurrences (a validation rule that will cause failure or misbehavior if violated) and files over 8 MB are rejected. It still does not say what happens on a count mismatch (error vs partial application) or whether edits are atomic.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three short sentences with the key constraint (exact match, not regex) front-loaded, and no filler. It is efficient, though the middle sentence largely duplicates the schema's edit-object documentation.

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 multi-edit mutation tool with no output schema, the description covers the critical input contract and a size limit but omits failure behavior on count mismatch, atomicity of the edit list, and any indication of what is returned. Adequate but with notable gaps for a destructive operation.

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 coverage is 100%, so old_text, new_text, and count are already documented in the schema with equivalent wording. The description restates that structure and the count semantics rather than adding new meaning (ordering effects, encoding, expect_hash behavior are untouched).

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') and immediately distinguishes it from regex-based editing, which helps separate it from siblings like fs_splice. It stops short of naming the sibling that handles patterns, so the differentiation is generic rather than explicit.

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 phrase 'not a regular expression' implies when this tool is the right choice (literal, exact-match replacement), but there is no explicit when-not guidance, no mention of fs_splice/fs_write as alternatives, and no stated prerequisites such as the file needing to be readable/writable.

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