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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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
        """
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the tool retrieves memo details but lacks information on permissions needed, error handling (e.g., what happens if the UID is invalid), rate limits, or whether it's a read-only operation. This leaves significant gaps in understanding the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, starting with the core purpose followed by structured sections for Args and Returns. Every sentence adds value without redundancy, making it efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (1 parameter) and the presence of an output schema, the description is largely complete. It covers the purpose, parameter semantics, and return format. However, it could benefit from more behavioral details like error handling or permissions, which are not addressed in annotations or output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaningful context beyond the input schema by explaining that memo_uid is 'The UID of the memo to retrieve' and provides an example ('e.g., "abc123"'). Since schema description coverage is 0%, this compensates well, though it could detail format constraints or validation rules more explicitly.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Get') and resource ('a specific memo by its UID'), distinguishing it from sibling tools like create_memo, search_memos, and update_memo. It precisely defines what the tool does without being vague or tautological.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by specifying retrieval by UID, suggesting it's for when you know the exact memo identifier. However, it does not explicitly state when to use this tool versus alternatives like search_memos, which might be for broader queries, leaving some guidance implicit rather than explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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