Skip to main content
Glama

Edit

edit
Destructive

Replaces old_string with new_string in a note, an app file, an app's data.json or a text file (TXT, CSV, JSON, code), like a coding agent's Edit. old_string is the exact text, without line numbers, and the item must have been read in this session. It must match once unless replace_all; an empty new_string deletes it. Answers with checks: what the change broke in a note (a table, a checklist line, a tracker value), or the app's compile, render and test results. Each edit is one change the person can undo.

Input Schema

NameRequiredDescriptionDefault
pathYesA path, as list and search show them: "Work/Acme.md", a folder "Work/", a sub-note "Work/Acme/Agenda.md", a note's file "Work/Acme/contract.pdf", a file in a folder "To read/Paper.pdf", an app's file "Work/Habits.app/src/App.tsx" or its data "Work/Habits.app/data.json".
new_stringYesThe text to put there.
old_stringYesThe exact text to replace.
replace_allNoReplace every occurrence. Default false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior5/5

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

Annotations declare destructive and non-readonly behavior; the description adds rich context beyond that: read-session prerequisite, exact-match semantics, empty-string deletion, validation feedback (what broke, compile/render/test), and undoability per edit. This substantially exceeds annotation coverage.

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?

Five dense sentences, front-loaded with the core operation and scope. Every sentence earns its place by conveying constraints, behavior, or return details without redundancy.

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

Completeness5/5

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

No output schema exists, but the description explains return/validation behavior ('Answers with checks...'). Annotations cover safety, schema covers paths and parameters, and the description fills remaining gaps, making it complete for a complex destructive edit tool.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3. The description adds meaningful semantics for key parameters: old_string is exact text without line numbers, must match once unless replace_all, and empty new_string deletes. It does not add much for path beyond the schema, but overall adds value beyond structured fields.

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 ('Replaces old_string with new_string') and resource targets (note, app file, data.json, text file), making the operation clear. However, it does not explicitly differentiate itself from sibling tools like write or create, which could also modify content.

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?

Gives clear usage context: the item must have been read in this session, old_string must be exact and match once unless replace_all, and an empty new_string deletes. No explicit alternatives (e.g., when to use write instead) or when-not-to-use guidance is provided.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.