Skip to main content
Glama

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
NameRequiredDescriptionDefault
memo_uidYes

Implementation Reference

  • 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()
  • 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
        """
Install Server

Other Tools

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/Red5d/memos_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server