Skip to main content
Glama
arjunkmrm

Mem0 MCP Server

get_memory

Retrieve a specific stored memory by its unique ID to access persistent user data, conversation history, or contextual information from previous sessions.

Instructions

Fetch a single memory once you know its memory_id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
memory_idYesExact memory_id to fetch.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The core handler function for the 'get_memory' tool, which fetches a specific memory by ID using the Mem0 MemoryClient's get method, wrapped in error handling via _mem0_call.
    def get_memory(
        memory_id: Annotated[str, Field(description="Exact memory_id to fetch.")],
        ctx: Context | None = None,
    ) -> str:
        """Retrieve a single memory once the user has picked an exact ID."""
    
        api_key, _, _ = _resolve_settings(ctx)
        client = _mem0_client(api_key)
        return _mem0_call(client.get, memory_id)
  • Registers the 'get_memory' tool with the FastMCP server using the @server.tool decorator.
    @server.tool(description="Fetch a single memory once you know its memory_id.")
Behavior2/5

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

With no annotations provided, the description carries full burden but offers limited behavioral insight. It states it 'fetches' a memory, implying a read operation, but doesn't disclose permissions, rate limits, error conditions, or what happens if the memory_id is invalid. The description adds little beyond the basic action.

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 with zero waste. It's front-loaded with the core action and key constraint ('once you know its memory_id'), making it easy to parse quickly.

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 tool's low complexity (single required parameter) and the presence of an output schema (which handles return values), the description is reasonably complete. It covers the basic purpose and key usage hint, though more behavioral context would be beneficial given the lack of 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%, so the schema fully documents the single parameter 'memory_id'. The description adds marginal value by emphasizing 'Exact' and 'once you know its memory_id', reinforcing it's for precise lookup, but doesn't provide additional syntax or format details beyond the schema.

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 the action ('Fetch') and resource ('a single memory'), making the purpose understandable. It distinguishes from siblings like 'get_memories' (plural) by specifying 'single', but doesn't explicitly contrast with other retrieval tools like 'search_memories'.

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

Usage Guidelines2/5

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

The description provides minimal guidance: 'once you know its memory_id' implies this tool is for direct lookup rather than discovery. However, it doesn't explain when to use this versus alternatives like 'get_memories' (bulk retrieval) or 'search_memories' (query-based), nor does it mention prerequisites or exclusions.

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