get_memo
Retrieve a specific memo by its unique identifier to access stored knowledge content, tags, and details from the Memos knowledge management system.
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
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| memo_uid | Yes |
Implementation Reference
- server.py:279-322 (handler)Implementation of the get_memo tool handler. Retrieves a memo by its UID from the Memos API using HTTP GET request, formats the response as JSON string, and handles errors. Registered via @mcp.tool() decorator.@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)}"
- server.py:279-279 (registration)The @mcp.tool() decorator registers the get_memo function as an MCP tool.@mcp.tool()
- server.py:280-289 (schema)Function signature and docstring defining the input schema (memo_uid: str) and output (str JSON).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 """