Skip to main content
Glama

muninn_memory_anchor_replace

DestructiveIdempotent

Replace the span between beginAnchor and endAnchor (inclusive) with newText. Cheaper than resending the whole body when editing a large block — send only the two anchors and the replacement. Both anchors must appear EXACTLY ONCE in the current body; the server rejects if either is missing or appears more than once (never guesses). beginAnchor must precede endAnchor. To delete a span: pass newText as empty string. Returns {id, length} as self-verify. memoryId accepts a short-form 8-char prefix. Works on artifacts too (artifactId IS memoryId) — a published artifact's public link is refreshed automatically. Optional expectedRev: the rev from the read you based these anchors on — the write is REJECTED (nothing written) if the body moved since. Omit for a read-then-immediately-write.

Input Schema

NameRequiredDescriptionDefault
newTextYesReplacement text for the entire span (beginAnchor through endAnchor inclusive). Pass empty string to delete the span.
memoryIdYesMemory ID to edit (full UUID or unique 8-char prefix)
endAnchorYesExact string marking the END of the span to replace — must appear exactly once and after beginAnchor
beginAnchorYesExact string marking the START of the span to replace — must appear exactly once
expectedRevNoThe `rev` from the read you based this edit on. Rejects the write if the body has changed since. Omit to skip the check.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare the safety profile (destructive, idempotent, openWorld); the description adds substantial context beyond that: exact-once anchor matching with no guessing, ordering requirement, delete semantics, return value {id, length}, short-form 8-char memoryId, artifact support with automatic public-link refresh, and the optimistic-concurrency behavior of expectedRev (write REJECTED, nothing written). Note a latent tension: the 'rejects if either anchor is missing' rule means a repeat call would fail, which sits awkwardly with idempotentHint=true, but the description itself is accurate and not misleading.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the core operation, then rationale, constraints, delete case, return value, artifact note, and rev guidance. Every clause is informative, though the description is dense and runs long enough that a couple of points (artifact note, expectedRev) could be tightened.

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 compensates fully: it documents the return shape ({id, length}), concurrency handling via expectedRev, edge cases (delete, exactly-once anchors, ordering), and artifact-specific side effects. Nothing an agent needs to call this correctly is missing.

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: it clarifies the relationship between the two anchors (ordering, uniqueness) and, most valuably, when to use or omit expectedRev ('the rev from the read you based these anchors on', omit for read-then-immediately-write).

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: replace the span between beginAnchor and endAnchor with newText. It also implicitly distinguishes itself from whole-body editing siblings (muninn_memory_update/muninn_memory_append) by explaining it is 'cheaper than resending the whole body'. An agent can tell what this does and why it exists without opening the 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 covers when to use it (editing a large block), how to delete (newText as empty string), and the exact condition for expectedRev ('omit for a read-then-immediately-write'). It also states the failure conditions (anchors missing or appearing more than once) so the agent knows when the call will be rejected.

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