Skip to main content
Glama

memory_edit

DestructiveIdempotent

Edit existing memories with exact search/replace, update metadata (description/tags) without rewriting content, and apply changes atomically—all edits succeed or none do.

Instructions

Edit an existing memory in place with exact search/replace, instead of resending its whole body through memory_write. 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. It is also the only way to change a memory's description or tags on their own: send description/tags_add/tags_remove with no edits and the body is left untouched (memory_write requires a body, so there was no metadata-only path before this), and tags_remove is the only way to clear a tag at all. Returns a unified diff of what landed plus the new content_hash. Use this for corrections that do not change what the item CLAIMS: typos, broken formatting, a stale path or command, a stage's Status flip, metadata. If the MEANING changes -- the conclusion is now different, the advice reversed -- that is a new memory: use memory_write with supersedes, which retires the old one into readable history instead of erasing what it used to say.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesmemory name (kebab-case, as memory_read takes it)
editsNoordered 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.
projectNoproject slug; defaults to the bound/ambient session's project, then global. Pass project=global to target a global memory.
tags_addNotags to add, leaving the rest in place (a comma-separated string is also accepted)
descriptionNoreplace the one-line description (<=150 chars -- the only text shown in indexes); omit to leave it untouched
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.
tags_removeNotags to remove, leaving the rest in place; this is how a tag gets cleared (a comma-separated string is also accepted)
Behavior5/5

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

Even with annotations (readOnlyHint false, destructiveHint true, idempotentHint true), the description adds substantial behavioral detail: all-or-nothing atomic application, exact/uniqueness matching, failed match changes nothing, metadata-only path, tags_remove as the only way to clear a tag, and a unified diff plus content_hash in the return. No contradiction with annotations.

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?

The description is front-loaded with the core purpose, then logically expands into matching rules, metadata-only capability, return value, and usage boundaries. Every sentence adds distinct value; no fluff or redundancy. Length is justified by the tool's nuanced behavior.

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?

With no output schema, the description covers the return value (unified diff + content_hash). It also handles edge cases (metadata-only edits, tag clearing, meaning changes) and explains when to prefer memory_write. Combined with the detailed input schema, this is a fully self-contained description.

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%, so the baseline is 3. The description adds minor practical guidance like 'include surrounding lines to make it unique' and reiterates matching semantics, but the parameters are already thoroughly documented in the schema. The description doesn't significantly elevate parameter understanding beyond the schema.

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?

The description opens with a specific verb and resource: 'Edit an existing memory in place with exact search/replace,' immediately distinguishing it from memory_write and memory_append. It clearly states scope (existing memory, in-place) and mechanism (search/replace), and the sibling context confirms this is a unique editing tool.

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?

Provides explicit when-to-use: 'corrections that do not change what the item CLAIMS: typos, broken formatting, a stale path or command, a stage's Status flip, metadata.' Also gives a clear exclusion: 'If the MEANING changes ... use memory_write with supersedes.' This is exemplary guidance that prevents mis-selection among sibling tools.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/0spoon/seamless'

If you have feedback or need assistance with the MCP directory API, please join our Discord server