Skip to main content
Glama
mem0ai

Mem0 MCP Server

Official
by mem0ai

update_memory

Modify existing stored information by replacing text in a specific memory to maintain accurate and current coding preferences.

Instructions

Overwrite an existing memory’s text.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
memory_idYesExact memory_id to overwrite.
textYesReplacement text for the memory.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The `update_memory` tool handler function, registered with @server.tool, which overwrites the text of an existing memory using the Mem0 client's update method.
    @server.tool(description="Overwrite an existing memory’s text.")
    def update_memory(
        memory_id: Annotated[str, Field(description="Exact memory_id to overwrite.")],
        text: Annotated[str, Field(description="Replacement text for the memory.")],
        ctx: Context | None = None,
    ) -> str:
        """Overwrite an existing memory’s text after the user confirms the exact memory_id."""
    
        api_key, _, _ = _resolve_settings(ctx)
        client = _mem0_client(api_key)
        return _mem0_call(client.update, memory_id=memory_id, text=text)
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'Overwrite' which implies a destructive mutation, but doesn't specify permissions needed, whether the operation is reversible, rate limits, error conditions (e.g., if memory_id doesn't exist), or what the output contains. For a mutation tool with zero annotation coverage, this is a significant gap.

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 a single, efficient sentence that directly states the tool's purpose without any fluff. It is front-loaded and every word earns its place, making it easy for an AI agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema (which handles return values), 100% schema description coverage, and no complex nested objects, the description is minimally adequate. However, as a mutation tool with no annotations, it lacks critical behavioral context like safety warnings or error handling, leaving gaps in completeness.

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%, with clear descriptions for both parameters (memory_id as 'Exact memory_id to overwrite' and text as 'Replacement text for the memory'). The description adds no additional parameter semantics beyond what the schema provides, such as format details or constraints. Baseline 3 is appropriate when the schema does the heavy lifting.

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 clearly states the specific action ('Overwrite') and resource ('an existing memory's text'), distinguishing it from siblings like add_memory (create), delete_memory (remove), get_memory (read), and search_memories (query). It precisely communicates a mutation operation on a specific memory's content.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., that the memory must exist), exclusions (e.g., not for creating new memories), or comparisons to siblings like add_memory for creation or get_memory for reading. Usage is implied but not explicitly stated.

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/mem0ai/mem0-mcp'

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