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.

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)

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