Skip to main content
Glama

update_memory

Modify existing stored information by replacing the text of a specific memory entry to maintain accurate and current 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

  • The main handler function for the 'update_memory' tool. It is decorated with @server.tool, which registers it with the FastMCP server. The function calls the Mem0 client's update method to overwrite the memory text given a memory_id.
    @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 full burden. It mentions 'overwrite' which implies a destructive mutation, but doesn't disclose behavioral traits like permission requirements, whether the operation is reversible, rate limits, or what happens to the old text. 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 with zero waste. It's front-loaded and appropriately sized for the tool's complexity, making it easy 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 that there's an output schema (which covers return values), no annotations, and high schema coverage, the description is minimally adequate. However, as a mutation tool with no behavioral disclosure, it lacks completeness for safe and effective use by an AI agent.

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 the schema already documents both parameters ('memory_id' and 'text') thoroughly. The description adds no additional meaning beyond what the schema provides, such as format details or constraints, but doesn't need to compensate for gaps.

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 ('an existing memory's text'), making the purpose immediately understandable. It doesn't explicitly distinguish from siblings like 'add_memory' or 'delete_memory', but the verb 'overwrite' implies modification rather than creation or removal.

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' or 'delete_memory'. The description only states what it does without context about prerequisites, timing, or comparisons to 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/parthshr370/mem0_mcp_private'

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