Skip to main content
Glama

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
NameRequiredDescriptionDefault
memory_idYesExact memory_id to delete.

Implementation Reference

  • 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)

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