Skip to main content
Glama
mem0ai

Mem0 MCP Server

Official
by mem0ai

get_memory

Retrieve a specific stored coding preference by its unique ID to maintain consistent programming practices.

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 main handler function for the 'get_memory' tool. It resolves the API key, gets the Mem0 client, and calls client.get(memory_id) wrapped in error handling via _mem0_call.
    @server.tool(description="Fetch a single memory once you know its memory_id.")
    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)
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states the basic action of fetching a memory and doesn't cover important aspects like error handling (e.g., what happens if the memory_id doesn't exist), authentication needs, rate limits, or whether it's a read-only operation. This leaves significant gaps for an agent to understand the tool's behavior.

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 directly states the tool's purpose and key prerequisite. It is front-loaded with essential information and contains no unnecessary words, making it highly concise and well-structured.

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 that there is an output schema (which handles return values), a simple parameter set with full schema coverage, and no annotations, the description adequately covers the basic purpose and usage. However, it lacks details on behavioral aspects like error cases or permissions, which are important for a tool that fetches data, slightly reducing completeness.

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?

The input schema has 100% description coverage, with the parameter 'memory_id' clearly documented as 'Exact memory_id to fetch.' The description adds minimal value by reiterating the need for a memory_id but doesn't provide additional context like format examples or constraints beyond what the schema already states, meeting the baseline for high schema coverage.

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. However, it doesn't distinguish this tool from sibling tools like 'get_memories' or 'search_memories' beyond mentioning the need for a specific memory_id, which is already implied by the tool name.

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

Usage Guidelines3/5

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

The description provides some guidance by stating 'once you know its memory_id,' which implies this tool should be used when you have a specific identifier. However, it doesn't explicitly compare it to alternatives like 'get_memories' for listing multiple memories or 'search_memories' for finding memories without an ID, leaving usage context partially implied.

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