Skip to main content
Glama

edit

Destructive

Replace a specific string in a text file with new text. Specify the file path, old string, new string, and optionally replace all occurrences.

Instructions

Replace old_string with new_string in a text file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFile path relative to the server root
new_stringYesReplacement text
old_stringYesText to replace
replace_allNoReplace every occurrence

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

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

The destructiveHint annotation already signals destructive behavior, and the description does not add further context such as irreversibility, in-place modification, or behavior when old_string is not found. The description restates the basic action without disclosing additional side effects or requirements.

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, clear sentence that is front-loaded with the primary action and parameters. It is concise with no filler, earning a perfect score for structure.

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?

The description is minimal but, combined with the full schema and destructive annotation, provides a basic understanding of the tool. However, it lacks usage guidance and does not elaborate on the effects of the operation or edge cases, making it adequate but not comprehensive for a destructive edit tool.

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 schema covers all 4 parameters with descriptions, so the baseline is 3. The description references old_string and new_string in context, but adds no additional semantic meaning beyond what the schema already provides. It does not explain replace_all behavior or path resolution beyond the schema.

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 'Replace *old_string* with *new_string* in a text file' uses a specific verb ('Replace') and identifies the resource ('text file'), clearly distinguishing it from read-only siblings like read/grep/find/ls and write (which creates/overwrites files). The purpose is unambiguous.

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 use for editing existing text files but does not explicitly state when to use this tool versus alternatives (e.g., write for full-file rewrites) or when not to use it. No exclusions or alternative suggestions are provided, though the intended context is inferable from the wording.

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/garland3/basic-fns-mcp'

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