Skip to main content
Glama
Phygital-Brain

phygital-memory

Official

replace_in_note

Edits an existing note by swapping exact old text for new text; the change saves only when the old text appears once, preventing ambiguous updates.

Instructions

Change part of an existing note: replaces old_text with new_text. old_text must appear exactly once, or nothing is saved and the error says how many times it was found; call read_note first and copy it exactly. Name the note by path (best for several edits in a row, since it stays valid) or by a search or handed id. Use append_to_note to add at the end instead, and create_note for a new note. Needs Allow edits; each save makes a version, and the person can undo it in the app. Returns the saved path.

Input Schema

NameRequiredDescriptionDefault
idNoA search_notes or handed note id. Or leave empty and give path.
pathNoThe note's path, like 'Projects/plan.md'. It stays valid after edits, unlike a search id.
folderNoWhich unlocked folder (its name, from status). Leave empty when only one is open.
privateNoTrue only when the person asked, in this chat, for something in a folder they keep private.
new_textYesWhat to put in its place.
old_textYesExact text now in the note (from read_note).

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Goes well past the annotations: discloses the exact-match/unique occurrence precondition and the failure mode ('nothing is saved and the error says how many times it was found'), the Allow edits permission requirement, that each save creates a version the person can undo, and what is returned. The annotations only say non-destructive and closed-world, so this context is genuinely additive.

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?

Front-loaded with the action and the core constraint, then the addressing options, then the alternatives, then side effects. Dense but every clause carries information an agent needs before calling.

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?

For a mutating tool with an output schema present, the description covers the prerequisite read, the failure condition, permissions, reversibility, and returns the saved path. Nothing material to a correct invocation is missing.

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% and the parameters already document id vs path, folder, and private in detail. The description's path-vs-id advice largely restates the schema's own 'stays valid after edits, unlike a search id' note and says nothing about folder or private, so it adds little beyond the structured fields.

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?

States a specific verb and resource ('Change part of an existing note: replaces old_text with new_text') and immediately distinguishes itself from append_to_note and create_note by naming both siblings. An agent can pick this over the alternatives without opening a schema.

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

Usage Guidelines5/5

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

Explicit routing: use append_to_note to add at the end, create_note for a new note, and read_note first to copy old_text exactly. It also gives a selection rule between the two addressing modes (path is best for several edits in a row because it stays valid; otherwise a search or handed id).

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