Skip to main content
Glama
mem0ai

Mem0 MCP Server

Official
by mem0ai

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.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'delete_memory' tool. It is decorated with @server.tool for registration in the MCP server. Takes memory_id and optional ctx, resolves API key, creates Mem0 client, and calls client.delete via _mem0_call.
    @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)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the deletion action and user confirmation, but lacks details on permissions required, whether the deletion is permanent or reversible, error handling, or rate limits. For a destructive operation, this is a significant gap in transparency.

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 that front-loads the key action ('Delete one memory') and includes essential context ('after the user confirms its memory_id'). There is no wasted verbiage, making it appropriately sized and structured for clarity.

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 the tool's complexity (a destructive operation with one parameter) and the presence of an output schema (which handles return values), the description is moderately complete. It covers the purpose and usage context but lacks behavioral details like safety warnings or error scenarios, which are important for a deletion tool with no annotations.

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%, with the parameter 'memory_id' documented as 'Exact memory_id to delete.' The description adds minimal value by restating this parameter in context ('its memory_id'), but does not provide additional semantics beyond what the schema already covers, aligning with the baseline for high schema coverage.

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

Purpose5/5

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

The description clearly states the specific action ('Delete one memory') and the resource ('memory'), distinguishing it from siblings like 'delete_all_memories' (which deletes multiple) and 'delete_entities' (which targets different resources). It precisely conveys the tool's function without being vague or tautological.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for usage by specifying 'after the user confirms its memory_id,' indicating a prerequisite of user confirmation. However, it does not explicitly state when to use this tool versus alternatives like 'delete_all_memories' or 'update_memory,' missing explicit sibling differentiation.

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

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