delete_memory
Remove specific stored coding preferences from the Mem0 MCP Server by providing the exact memory ID to delete.
Instructions
Delete one memory after the user confirms its memory_id.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| memory_id | Yes | Exact memory_id to delete. |
Implementation Reference
- src/mem0_mcp_server/server.py:402-412 (handler)The delete_memory tool handler function, decorated with @server.tool for registration in the FastMCP server. It resolves the Mem0 API key and client, then calls the client's delete method with the provided memory_id. Input schema is defined inline using Pydantic's Annotated and Field.@server.tool(description="Delete one memory after the user confirms its memory_id.") def delete_memory( memory_id: Annotated[str, Field(description="Exact memory_id to delete.")], ctx: Context | None = None, ) -> str: """Delete a memory once the user explicitly confirms the memory_id to remove.""" api_key, _, _ = _resolve_settings(ctx) client = _mem0_client(api_key) return _mem0_call(client.delete, memory_id)