Skip to main content
Glama

replaceBlock

Destructive

Replace exact text blocks in workspace files using content matching. Provides clear error messages when text not found or match is ambiguous.

Instructions

Replace exact text block in a workspace file by content match, no line numbers. Fails clearly if not found or ambiguous.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesWorkspace or absolute file path
oldContentYesThe exact text to find and replace (must match precisely, including whitespace)
newContentYesThe text to replace oldContent with
saveNoSave after replacing (default: true)
Behavior3/5

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

Annotations already indicate destructiveHint=true, so description's role is to add context. Description adds failure behavior but does not explicitly confirm file modification or consequences. It adds some value beyond annotations.

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 sentences, no redundant information. Essential details are front-loaded: verb, resource, method, failure case. Highly efficient.

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?

Tool is simple with no output schema. Description covers purpose, matching method, and failure behavior. Sufficient for an agent to understand usage and constraints.

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?

Input schema covers all 4 parameters with descriptions. Description does not add additional semantic meaning beyond what schema provides, so baseline 3 is appropriate.

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 description clearly states the action (replace), resource (exact text block in workspace file), method (by content match, not line numbers), and failure behavior (clear fail if not found or ambiguous). It distinguishes from siblings like searchAndReplace or editText.

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

Usage Guidelines4/5

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

The description explicitly mentions 'no line numbers' implying when to use this over line-number-based edits, and that it requires an exact match. It doesn't explicitly mention when not to use or name alternatives, limiting clarity on alternative tools.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Oolab-labs/patchwork-os'

If you have feedback or need assistance with the MCP directory API, please join our Discord server