Skip to main content
Glama
Pranav-stac

utf8-file-ops

by Pranav-stac

utf8_replace

Replace text in an existing file and save as UTF-8 on Windows, avoiding Cursor's StrReplace compatibility issues.

Instructions

Replace text in an existing file and save as UTF-8. Use instead of Cursor StrReplace on Windows.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path to the file
new_stringYesReplacement text
old_stringYesExact text to find
replace_allNoReplace all occurrences (default: false)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses that the tool modifies an existing file and writes UTF-8, which conveys mutation and encoding behavior. However, it does not explain what happens when old_string is not found, whether the file is rewritten atomically, or if replace_all affects error handling—leaving some behavioral ambiguity.

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 description is a single, two-part sentence with no filler. The primary action is front-loaded, and the usage guidance is appended without redundancy. Every word earns its place.

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 simple file-replacement tool with a fully documented schema, the description covers purpose, encoding, and the Windows-specific rationale. It does not mention return values or failure behaviors, but no output schema exists and these are less critical for such a straightforward 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 description coverage is 100%, so the parameters path, old_string, new_string, and replace_all are already individually documented. The description adds no additional parameter-level meaning beyond what the schema provides, so the baseline score of 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 states a specific verb and resource: 'Replace text in an existing file and save as UTF-8.' It clearly distinguishes the operation from the sibling tools utf8_write and utf8_verify by focusing on modification of existing content rather than creation or verification.

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 phrase 'Use instead of Cursor StrReplace on Windows' provides an explicit context for when this tool should be chosen over a known alternative. It doesn't explicitly contrast with sibling tools, but the domain of Windows-specific UTF-8 replacement is a clear usage signal.

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

Deploy Server

Other Tools