Skip to main content
Glama

edit

Destructive

Replace literal text in a remote UTF-8 file over SSH by specifying the target host, file path, old and new strings.

Instructions

Edit an existing UTF-8 text file by replacing literal text. REMOTE: paths live on selected target (ssh target.ssh); the edit is applied on the remote host. Read the file first (the read-before-edit policy still applies by convention).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetYesExact target name from remote_ssh_targets list. Always select the intended host explicitly.
file_pathYesPath to edit, on the remote host selected target. A relative path resolves against the target root.
new_stringYesLiteral replacement text. Use an empty string to delete the match.
old_stringYesLiteral text to replace. Must match exactly.
replace_allNoReplace all matches. Defaults to false; when false, old_string must appear exactly once.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already flag destructive=true and openWorld=true, so the safety profile is covered. The description adds genuinely new behavioral context: paths resolve against a selected ssh target and the edit executes on the remote host rather than locally. It does not describe failure behavior when old_string is absent or non-unique.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three compact sentences, front-loaded with the core purpose before the remote caveat and the read-first convention. No redundant restatement of the name or schema fields.

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?

With annotations covering the destructive/write profile and a fully described schema, the description supplies the missing environmental context (remote host, target selection, read-first convention). Only edge-case behavior on failed matches is unaddressed, which is a minor gap for this tool's complexity.

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 coverage is 100%, so all five parameters are already documented, including the exact-match and single-occurrence rules for old_string. The description reinforces the remote-target meaning of file_path but adds no syntax or format detail beyond the schema, so baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Edit an existing UTF-8 text file') and narrows the mechanism to 'replacing literal text', which distinguishes it from the whole-file sibling write. It stops short of explicitly naming write as the alternative for full-file changes.

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?

Gives one useful procedural rule (read the file first; read-before-edit policy applies by convention) and clarifies the remote context. It never says when to prefer write over edit, nor when not to use this tool, so routing guidance is only implied.

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