Skip to main content
Glama

get_memory

Retrieve a specific stored memory by its unique ID to access persistent user data, preferences, or conversation history 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.

Implementation Reference

  • The handler function for the get_memory tool, including its registration via @server.tool decorator. It fetches a specific memory by its ID using the Mem0 MemoryClient.get method, with error handling and JSON serialization via helper functions.
    @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)

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