Skip to main content
Glama

notes_edit

DestructiveIdempotent

Edit an existing note in place by note id with exact search/replace edits, avoiding full-body rewrites. Applies all edits atomically or none, returning a unified diff and new content_hash.

Instructions

Edit an existing note in place with exact search/replace, by id, instead of resending its whole body through notes_update. Each edit's old_string must match the current body exactly and uniquely (or pass replace_all); all edits apply together or none do, so a failed match changes nothing. This is the tool for correcting or restructuring part of a long note -- notes_append only ever adds, and notes_update replaces the whole body. Returns a unified diff of what landed plus the new content_hash.

Input Schema

NameRequiredDescriptionDefault
idYesnote id (ULID), as notes_create returns and briefings and plan compositions carry
editsYesordered list of exact search/replace edits, applied in order to the CURRENT body. Each is {old_string, new_string, replace_all?}. old_string must match the body EXACTLY (whitespace and indentation included) and must be unique unless replace_all is true; include surrounding lines to make it unique. All-or-nothing: if any edit fails to match, nothing is written.
sessionNothe session to act as: the name session_start returned, the cc/<id> or cx/<id> on your briefing's 'Seam session' line, or a session ULID. It scopes and credits this call. Defaults to this connection's session; pass it on every call when session_start reports the connection as stateless
expect_hashNooptional precondition: the content_hash you last read for this item (memory_read/notes_read return it). The write is refused if the stored file has changed since -- another agent or the owner edited it -- so re-read and re-apply your change instead of overwriting theirs. Omit it to write unconditionally.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.7.4
    • addedInput schema / properties / session
      Added value: +{
      +  "description": "the session to act as: the name session_start returned, the cc/<id> or cx/<id> on your briefing's 'Seam session' line, or a session ULID. It scopes and credits this call. Defaults to this connection's session; pass it on every call when session_start reports the connection as stateless",
      +  "type": "string"
      +}
  2. Addedv0.4.11

TDQS

A4.7/5.0
Behavior5/5

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

Adds substantial context beyond the annotations: it discloses all-or-nothing atomicity ('all edits apply together or none do, so a failed match changes nothing'), the exact-and-unique matching requirement, and the return payload ('unified diff of what landed plus the new content_hash'). With readOnlyHint=false and destructiveHint=true already declared, the description still meaningfully extends the safety and behavior picture.

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?

Purpose is front-loaded in the first clause, followed by the matching constraint, atomicity, sibling differentiation, and return value. No sentence is filler and each clause earns its place, despite the density.

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 mutation tool with no output schema, the description covers atomicity, preconditions (exact unique match), the return format (diff + content_hash), and how it relates to sibling tools. Nothing an agent needs to invoke it correctly 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 description coverage is 100%, so id, edits, old_string, new_string, replace_all, session and expect_hash are all already documented in the schema. The description restates the old_string/replace_all relationship and the all-or-nothing rule, which the schema also covers, so it adds little beyond the structured fields. Baseline 3 is appropriate when the schema carries the load.

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 ('Edit an existing note in place with exact search/replace, by id') and immediately distinguishes itself from notes_update. It also names the mechanism (search/replace) and the sibling it is not, so an agent can route without opening any 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?

Explicitly names the alternatives and their conditions: 'notes_append only ever adds, and notes_update replaces the whole body,' and positions itself as the tool 'for correcting or restructuring part of a long note.' The when-to-use case is unambiguous and no inference is required.

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