Skip to main content
Glama

file_replace

Replaces an exact text substring in a target file to update specific content without rewriting the whole file.

Instructions

Replace exact text substring within a target file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesTarget file path.
targetYesExact text substring to replace.
replacementNoReplacement text substring.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are provided, so the description carries full responsibility for behavioral disclosure. It states that text is replaced, which implies file mutation, but it does not disclose that modifications are destructive or irreversible, nor what happens when the target substring is absent.

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, front-loaded sentence with no filler or repetition. Every word contributes to the core operation.

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?

The tool mutates a file and has no output schema or annotations, yet the description omits critical semantics such as whether all occurrences or only the first are replaced, and what happens if the target is not found. An agent could call this incorrectly because of that ambiguity.

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?

The input schema already documents all three parameters at 100% coverage, so the description adds limited new semantic value. The phrase 'exact text substring' usefully reinforces matching behavior but is not strictly necessary given the schema descriptions.

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 verb and resource ('Replace exact text substring within a target file'), making the operation unambiguous. It clearly distinguishes itself from broader siblings like file_read, file_write, and file_op by emphasizing 'exact text substring.'

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

Usage Guidelines2/5

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

The description gives no guidance on when to use this tool versus file_write or file_op, nor does it state when it should not be used. The operation is implied by the name and description, but the agent gets no explicit decision-making context.

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