Skip to main content
Glama
fabiolenine

mem0-mcp-selfhosted

add_memory

Add a memory with AI-driven fact extraction or raw text storage. Scoped by user, agent, or run for personalized management.

Instructions

Store a new memory. Requires at least one of user_id, agent_id, or run_id.

    Response contract (never a bare list):
    - {"status": "queued", "task_id", "submitted_at", "queue_depth", "estimated_wait_s"}
      — infer=true path; extraction runs in background, poll memory_task_status.
    - {"status": "stored", "memory_ids": [...], "results": [...]}
      — synchronous path; empty memory_ids carries "reason": "no_new_facts".
    - {"error": ...} — failure.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesText to store as a memory. Converted to messages format internally.
inferNoIf true (default), LLM extracts key facts asynchronously: the call returns a queued envelope with a task_id immediately (use memory_task_status to fetch the resulting memory_ids). If false, stores raw text synchronously.
run_idNoRun scope identifier.
user_idNoUser scope identifier. Defaults to MEM0_USER_ID.
agent_idNoAgent scope identifier.
messagesNoStructured conversation history (role/content dicts). When provided, takes precedence over text.
metadataNoArbitrary metadata JSON to store alongside the memory.
enable_graphNoOverride default graph toggle for this call.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description fully discloses the two execution paths and the exact response contracts for each. It covers both success and error cases. While it lacks details on authentication or rate limits, it provides essential behavioral context for an AI agent.

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 extremely concise, front-loaded with the action, and uses a clear bullet-like structure for the response contract. Every sentence provides necessary information without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (8 parameters, 1 required) and the presence of an output schema described inline, the description covers the main behavior, response contracts, and a key prerequisite. It does not elaborate on edge cases like conflicting text and messages, but the schema addresses that. Overall, it is sufficiently complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description adds value by explicitly stating the constraint that at least one of user_id, agent_id, or run_id is required, which is not present in individual parameter descriptions. This enhances parameter semantics.

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

Purpose4/5

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

The description clearly states 'Store a new memory', specifying the action and resource. It adds a prerequisite about required identifiers. While it distinguishes from siblings like 'delete_memory' or 'get_memories', it does not explicitly contrast with 'add_document', but the purpose is clear enough.

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 explains when to use the async vs sync path based on the 'infer' parameter and how to poll for async results. It gives a prerequisite (one of user_id, agent_id, run_id). However, it does not provide exclusions for when not to use this tool compared to alternatives.

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/fabiolenine/mcp_deepmen0'

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