Skip to main content
Glama
arjunkmrm

Mem0 MCP Server

update_memory

Modify existing stored information by replacing the content of a specific memory with new text, enabling AI applications to maintain accurate and current long-term data.

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

  • Handler function for the 'update_memory' tool that executes the logic to update a memory's text using the Mem0 MemoryClient.
    @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?

With no annotations, the description carries full burden. It states 'overwrite' which implies mutation, but doesn't disclose critical behavioral traits: whether this is destructive (irreversible), requires specific permissions, has rate limits, or what happens on success/failure. The description is minimal and lacks operational context.

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 with zero waste. It's front-loaded with the core action and resource, making it immediately scannable and appropriately sized for the tool's complexity.

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 a mutation tool with no annotations but a complete input schema and an output schema (implied by 'Has output schema: true'), the description is minimally adequate. It covers the basic purpose but lacks guidance, behavioral context, and doesn't leverage the output schema to hint at return values. It meets the bare minimum for a simple update operation.

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 parameters are fully documented in the schema. The description adds no additional meaning beyond implying 'memory_id' identifies the target and 'text' is the replacement content, which is already clear from schema descriptions. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('overwrite') and resource ('existing memory's text'), making the purpose immediately understandable. It distinguishes from 'add_memory' (create new) and 'delete_memory' (remove), but doesn't explicitly differentiate from potential update-like siblings beyond the overwrite semantics.

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?

No guidance is provided on when to use this tool versus alternatives like 'add_memory' for new memories or 'get_memory' for retrieval. The description implies it's for existing memories but doesn't specify prerequisites (e.g., memory must exist) or exclusions (e.g., not for partial updates).

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

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