Skip to main content
Glama

patch_file

Destructive

Replace old_text with new_text in an existing note. old_text is copied exactly from read_file and must occur once (add context, or replace_all: true). Empty new_text deletes it.

Input Schema

NameRequiredDescriptionDefault
pathYes
new_textYes
old_textYes
workspaceNoUsually OMIT: the path finds its brain. Pass it only when a reply asks (new or ambiguous branch), with the brain the user named (if unclear ASK): id, 'mine', or owner name/email. A brain where the branch does not exist is refused.
replace_allNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / workspace / description
      Previous value: -"Brain to act on: its id, «mio» (yours), or the owner's name/email as shown by search. Usually OMIT it: a path that already lives in one brain is found there, for reads and writes alike. Pass it only when the tool tells you to (a NEW branch, or one that exists in several brains) — with the brain the user named; when they were not explicit ASK THEM. A brain where the branch does not exist is refused even if you name it."New value: +"Usually OMIT: the path finds its brain. Pass it only when a reply asks (new or ambiguous branch), with the brain the user named (if unclear ASK): id, 'mine', or owner name/email. A brain where the branch does not exist is refused."
  2. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already carry destructiveHint=true and readOnlyHint=false, so safety is covered; the description still adds real behavior the annotations can't express — unique-match requirement, the replace_all escape hatch, and that an empty new_text deletes content. It omits what happens on a failed/no match and whether the edit is atomic.

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?

Three tight sentences, front-loaded with the action, then the matching contract, then the edge case. No filler and nothing repeated from the schema.

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 destructive mutation tool with no output schema, the description covers the failure-prone behaviors an agent needs (exact copy, single occurrence, deletion via empty string). Missing only error/return behavior on no-match and multi-match without replace_all.

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 only 20% (just workspace), so the description must carry the load, and it does: old_text matching semantics, new_text empty-string deletion, and the role of replace_all are all explained in prose. Only `path` is left to obvious inference.

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 precise verb+resource+scope: replace old_text with new_text in an *existing* note, which implicitly separates it from creation tools. It never names the adjacent siblings it competes with (write_file, append_file), so an agent must infer the boundary rather than read it.

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 a concrete precondition ('old_text is copied exactly from read_file') and the escalation path when the condition fails ('add context, or replace_all: true'). No explicit when-not-to-use or named alternative among siblings, so it stops just short of a 5.

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.

Resources