get_memo
Retrieve a specific memo by its unique identifier to access stored knowledge, notes, or information from your Memos instance.
Instructions
Get a specific memo by its UID.
Args: memo_uid: The UID of the memo to retrieve (e.g., "abc123")
Returns: JSON string containing the memo details
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| memo_uid | Yes |
Input Schema (JSON Schema)
{
"properties": {
"memo_uid": {
"type": "string"
}
},
"required": [
"memo_uid"
],
"type": "object"
}
Implementation Reference
- server.py:279-321 (handler)The get_memo tool handler: an async function decorated with @mcp.tool() that retrieves a memo by UID from the Memos API, formats it as a JSON dict, and returns it as a string. Includes input type annotation (str) and comprehensive docstring describing args and returns.@mcp.tool() async def get_memo(memo_uid: str) -> str: """ Get a specific memo by its UID. Args: memo_uid: The UID of the memo to retrieve (e.g., "abc123") Returns: JSON string containing the memo details """ memo_name = f"memos/{memo_uid}" try: async with httpx.AsyncClient() as client: response = await client.get( f"{MEMOS_BASE_URL}/api/v1/{memo_name}", headers=get_headers(), timeout=30.0 ) response.raise_for_status() memo = response.json() # Format the response result = { "name": memo.get("name"), "uid": memo.get("uid"), "creator": memo.get("creator"), "content": memo.get("content"), "visibility": memo.get("visibility"), "pinned": memo.get("pinned", False), "createTime": memo.get("createTime"), "updateTime": memo.get("updateTime"), "displayTime": memo.get("displayTime"), "snippet": memo.get("snippet", ""), } return str(result) except httpx.HTTPError as e: return f"Error getting memo: {str(e)}" except Exception as e: return f"Unexpected error: {str(e)}"