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
| Name | Required | Description | Default |
|---|---|---|---|
| memory_id | Yes | Exact memory_id to fetch. |
Implementation Reference
- src/mem0_mcp_server/server.py:380-389 (handler)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)
- src/mem0_mcp_server/server.py:379-379 (registration)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.")