memory_get
Retrieve specific stored memories by ID from the Memora server, with options to include or exclude image data for optimized response handling.
Instructions
Retrieve a single memory by id.
Args: memory_id: ID of the memory to retrieve include_images: If False, strip image data from metadata to reduce response size
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| memory_id | Yes | ||
| include_images | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- memora/server.py:803-820 (handler)The implementation of the `memory_get` MCP tool, which retrieves a memory by ID from the database using `_get_memory` and optionally filters out image metadata.
async def memory_get(memory_id: int, include_images: bool = False) -> Dict[str, Any]: """Retrieve a single memory by id. Args: memory_id: ID of the memory to retrieve include_images: If False, strip image data from metadata to reduce response size """ record = _get_memory(memory_id) if not record: return {"error": "not_found", "id": memory_id} metadata = record.get("metadata") or {} if not include_images and metadata.get("images"): record["metadata"]["images"] = [ {"caption": img.get("caption", "")} for img in metadata["images"] ] return {"memory": record}