Skip to main content
Glama
arjunkmrm

Mem0 MCP Server

delete_all_memories

Remove all stored memories for a user, agent, app, or run while preserving the entity structure in the Mem0 MCP Server.

Instructions

Delete every memory in the given user/agent/app/run but keep the entity.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idNoUser scope to delete; defaults to server user.
agent_idNoOptional agent scope to delete.
app_idNoOptional app scope to delete.
run_idNoOptional run scope to delete.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The core handler function for the 'delete_all_memories' tool, decorated with @server.tool for registration. Processes arguments, resolves Mem0 configuration, validates with DeleteAllArgs schema, and calls the Mem0 client's delete_all method.
    @server.tool(
        description="Delete every memory in the given user/agent/app/run but keep the entity."
    )
    def delete_all_memories(
        user_id: Annotated[
            Optional[str], Field(default=None, description="User scope to delete; defaults to server user.")
        ] = None,
        agent_id: Annotated[
            Optional[str], Field(default=None, description="Optional agent scope to delete.")
        ] = None,
        app_id: Annotated[
            Optional[str], Field(default=None, description="Optional app scope to delete.")
        ] = None,
        run_id: Annotated[
            Optional[str], Field(default=None, description="Optional run scope to delete.")
        ] = None,
        ctx: Context | None = None,
    ) -> str:
        """Bulk-delete every memory in the confirmed scope."""
    
        api_key, default_user, _ = _resolve_settings(ctx)
        args = DeleteAllArgs(
            user_id=user_id or default_user,
            agent_id=agent_id,
            app_id=app_id,
            run_id=run_id,
        )
        payload = args.model_dump(exclude_none=True)
        client = _mem0_client(api_key)
        return _mem0_call(client.delete_all, **payload)
  • Pydantic model defining the input schema (arguments) for the delete_all_memories tool.
    class DeleteAllArgs(BaseModel):
        user_id: Optional[str] = Field(
            None, description="User scope to delete; defaults to server user."
        )
        agent_id: Optional[str] = Field(None, description="Optional agent scope filter.")
        app_id: Optional[str] = Field(None, description="Optional app scope filter.")
        run_id: Optional[str] = Field(None, description="Optional run scope filter.")
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While it states the destructive action ('Delete every memory'), it doesn't mention critical behavioral aspects like whether this operation is reversible, what permissions are required, confirmation requirements, rate limits, or what the output contains. The description is insufficient for a destructive bulk operation.

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 perfectly concise - a single sentence that front-loads the core action and immediately clarifies what is preserved. Every word earns its place with zero redundancy or unnecessary elaboration.

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 this is a destructive bulk operation with no annotations but with an output schema, the description is moderately complete. It clearly states the action and scope but lacks important behavioral context about safety, permissions, and consequences. The existence of an output schema reduces the need to describe return values, but more operational guidance is needed.

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?

With 100% schema description coverage, the baseline is 3. The description adds minimal value beyond the schema by implying these parameters define the scope ('in the given user/agent/app/run'), but doesn't explain parameter interactions, precedence, or what happens when multiple scopes are specified.

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 every memory') and resource ('in the given user/agent/app/run'), with explicit differentiation from sibling tools by specifying what is preserved ('but keep the entity'). This distinguishes it from delete_entities and delete_memory tools.

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 about when to use this tool - for bulk deletion of memories while preserving entities. However, it doesn't explicitly state when NOT to use it or name specific alternatives like delete_memory for individual deletions or delete_entities for entity removal.

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

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