Skip to main content
Glama

create_memo

Create a new memo with markdown content and set visibility levels (public, protected, or private) for knowledge management.

Instructions

Create a new memo.

Args: content: The content of the memo (supports Markdown) visibility: Visibility level - PUBLIC, PROTECTED, or PRIVATE (default: PRIVATE)

Returns: JSON string containing the created memo details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYes
visibilityNoPRIVATE

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The async handler function implementing the create_memo tool logic, which validates input, sends a POST request to the Memos API to create a memo, and returns formatted JSON response.
    async def create_memo(
        content: str,
        visibility: str = "PRIVATE"
    ) -> str:
        """
        Create a new memo.
        
        Args:
            content: The content of the memo (supports Markdown)
            visibility: Visibility level - PUBLIC, PROTECTED, or PRIVATE (default: PRIVATE)
        
        Returns:
            JSON string containing the created memo details
        """
        # Validate visibility
        valid_visibilities = ["PUBLIC", "PROTECTED", "PRIVATE"]
        visibility = visibility.upper()
        if visibility not in valid_visibilities:
            return f"Error: visibility must be one of {', '.join(valid_visibilities)}"
        
        # Build request payload
        payload = {
            "content": content,
            "visibility": visibility
        }
        
        try:
            async with httpx.AsyncClient() as client:
                response = await client.post(
                    f"{MEMOS_BASE_URL}/api/v1/memos",
                    json=payload,
                    headers=get_headers(),
                    timeout=30.0
                )
                response.raise_for_status()
                memo = response.json()
                
                # Format the response
                result = {
                    "success": True,
                    "memo": {
                        "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"),
                    }
                }
                
                return str(result)
                
        except httpx.HTTPError as e:
            return f"Error creating memo: {str(e)}"
        except Exception as e:
            return f"Unexpected error: {str(e)}"
  • server.py:131-131 (registration)
    The @mcp.tool() decorator registers the create_memo function as an MCP tool, using its signature for schema inference.
    @mcp.tool()
  • Function signature with type annotations defining input schema (content: str, visibility: str='PRIVATE') and output str, plus descriptive docstring.
    async def create_memo(
        content: str,
        visibility: str = "PRIVATE"
    ) -> str:
        """
        Create a new memo.
        
        Args:
            content: The content of the memo (supports Markdown)
            visibility: Visibility level - PUBLIC, PROTECTED, or PRIVATE (default: PRIVATE)
        
        Returns:
            JSON string containing the created memo details
        """
  • server.py:21-28 (handler)
    Helper function used by create_memo to generate authentication headers for API requests.
    def get_headers() -> dict:
        """Get headers for API requests including authentication"""
        headers = {
            "Content-Type": "application/json",
        }
        if MEMOS_API_TOKEN:
            headers["Authorization"] = f"Bearer {MEMOS_API_TOKEN}"
        return headers
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While it mentions the tool creates a memo and returns JSON, it doesn't address important behavioral aspects like authentication requirements, error conditions, rate limits, or whether the operation is idempotent.

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

Conciseness4/5

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

The description is appropriately sized and well-structured with clear sections for Args and Returns. Each sentence adds value, though the 'Create a new memo' statement is somewhat redundant with the tool name.

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

Completeness3/5

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

Given that there's an output schema (which handles return value documentation) and the description compensates well for the 0% schema description coverage, this is adequate. However, for a creation tool with no annotations, more behavioral context would be helpful.

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 significant value beyond the input schema, which has 0% description coverage. It explains that 'content' supports Markdown and defines the three possible values for 'visibility' (PUBLIC, PROTECTED, PRIVATE) along with the default. This compensates well for the schema's lack of descriptions.

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

Purpose4/5

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

The description clearly states the tool creates a new memo, which is a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'update_memo' or explain when to use this versus 'search_memos' for finding existing memos.

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

Usage Guidelines2/5

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

No guidance is provided about when to use this tool versus alternatives. The description doesn't mention prerequisites, when not to use it, or how it relates to sibling tools like 'get_memo', 'search_memos', or 'update_memo'.

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