Skip to main content
Glama
CosmGrid

Local MCP Dev Runner

by CosmGrid

Safely replace text

replace_text

Replace a specific text block in an existing file using a SHA-256 concurrency guard. Verify the file's expected hash to prevent overwriting concurrent changes.

Instructions

Replace exactly one text block in an existing file using an expected SHA-256 concurrency guard.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
newTextYes
oldTextYes
projectYes
expectedSha256Yes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
bytesYes
sha256Yes
projectYes
replacedYes
previousSha256Yes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv2.0.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the behavioral burden. It does disclose that the operation mutates an existing file, is limited to one text block, and is guarded by expectedSha256, which is meaningful context. However, it does not state failure behavior for hash mismatch, missing oldText, or multiple occurrences, nor any permission or side-effect details.

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?

The entire description is one efficient sentence with no filler. The primary action and the distinguishing concurrency guard are front-loaded, and every word contributes useful information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, zero schema parameter descriptions, and a mutation tool requiring a SHA-256 guard, this description is too thin. The agent still needs to know how to obtain expectedSha256, what error cases exist, and what project/path refer to. The output schema may cover return values, but it does not compensate for the missing operational guidance.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It adds some meaning for expectedSha256 ('concurrency guard') and implies oldText/newText roles, but project and path are left undefined, and no parameter mapping is provided. This is insufficient for five required parameters.

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 names a specific action ('Replace'), a specific resource ('text block in an existing file'), and key constraints ('exactly one', 'expected SHA-256 concurrency guard'). This clearly distinguishes it from sibling tools like create_file, delete_file, or search_text.

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 description implies usage for single targeted replacements rather than whole-file writes or multi-occurrence edits, but it never explicitly states when to use this tool versus alternatives. No sibling tool is named and no exclusion criteria are provided, so the agent must infer the boundary from the phrase 'exactly one text block'.

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

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/CosmGrid/local-mcp-dev-runner'

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