Skip to main content
Glama

Edit a passage in a note

edit_note

Replace one exact passage in a note's body with new text while keeping the rest unchanged; correct or update existing note content without rewriting the whole note.

Instructions

Replace one exact passage of a note's body with new text; the rest of the note stays as it was. old_text must appear exactly once (copy it from read_note, with enough surrounding words to be unique) unless replace_all is set. The safe way to correct or update existing text, in a note of any size; prefer it to replace_note_body.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "ref": "<ref>",
      "old_text": "<old_text>",
      "new_text": "<new_text>"
    },
    "name": "edit_note"
  }
}

Input Schema

NameRequiredDescriptionDefault
refYesNote path, title, or alias
new_textYesThe text to put in its place (may be empty to delete it)
old_textYesThe exact passage to replace, copied from the note's body
replace_allNoReplace every occurrence instead of requiring exactly one

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.4.0

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses that non-targeted text is preserved, that old_text must occur exactly once unless replace_all is set, and that this uniqueness constraint is why surrounding context is needed. It does not state what happens on failure (error vs. no-op) or what the call returns, which are the remaining behavioral gaps.

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 sentences, front-loaded with the core operation and its guarantee, then the constraint, then the safety/preference guidance. No redundant restatement of the title or schema text; every clause adds information.

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 4-parameter mutation tool with no annotations and no output schema, the description covers purpose, safety guarantee, failure precondition, and alternative routing. The main omission is post-call behavior (return value or error shape), which matters somewhat given no output schema exists.

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 the baseline is 3, but the description adds real meaning beyond the schema: the single-occurrence constraint on old_text, the workaround of adding surrounding words for uniqueness, and the override behavior of replace_all. These are semantics the schema field text does not convey.

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 precise verb+resource ('Replace one exact passage of a note's body with new text') and immediately bounds the scope ('the rest of the note stays as it was'). This is clearly distinguishable from replace_note_body and from read_note, which is named as the source of the passage to copy.

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?

Explicitly routes usage: use this 'to correct or update existing text' and 'prefer it to replace_note_body,' while read_note is named as the way to obtain old_text. Both the when-to-use and the primary alternative are stated, with the condition (exact passage replacement vs. whole-body replacement) implied clearly.

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