Skip to main content
Glama

update_memo

Modify existing memos by updating content, visibility, or pin status to maintain current information in your knowledge base.

Instructions

Update an existing memo.

Args: memo_uid: The UID of the memo to update (e.g., "abc123") content: New content for the memo (optional) visibility: New visibility level - PUBLIC, PROTECTED, or PRIVATE (optional) pinned: Whether to pin the memo (optional)

Returns: JSON string containing the updated memo details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
memo_uidYes
contentNo
visibilityNo
pinnedNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'update_memo' tool. It is registered via the @mcp.tool() decorator and implements the logic to update a memo's content, visibility, or pinned status by making a PATCH request to the Memos API. Includes input validation and error handling.
    @mcp.tool()
    async def update_memo(
        memo_uid: str,
        content: Optional[str] = None,
        visibility: Optional[str] = None,
        pinned: Optional[bool] = None
    ) -> str:
        """
        Update an existing memo.
        
        Args:
            memo_uid: The UID of the memo to update (e.g., "abc123")
            content: New content for the memo (optional)
            visibility: New visibility level - PUBLIC, PROTECTED, or PRIVATE (optional)
            pinned: Whether to pin the memo (optional)
        
        Returns:
            JSON string containing the updated memo details
        """
        # Validate visibility if provided
        if visibility is not None:
            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 update payload and update mask
        memo_data = {"state": "STATE_UNSPECIFIED"}
        update_paths = []
        
        if content is not None:
            memo_data["content"] = content
            update_paths.append("content")
        
        if visibility is not None:
            memo_data["visibility"] = visibility
            update_paths.append("visibility")
        
        if pinned is not None:
            memo_data["pinned"] = pinned
            update_paths.append("pinned")
        
        if not update_paths:
            return "Error: At least one field (content, visibility, or pinned) must be provided for update"
        
        # Build the full payload
        memo_name = f"memos/{memo_uid}"
        payload = {
            **memo_data
        }
    
        try:
            async with httpx.AsyncClient() as client:
                response = await client.patch(
                    f"{MEMOS_BASE_URL}/api/v1/{memo_name}",
                    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 updating memo: {str(e)}"
        except Exception as e:
            return f"Unexpected error: {str(e)}"
Behavior2/5

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

With no annotations provided, the description carries full burden but only states it 'updates an existing memo' without disclosing behavioral traits like permission requirements, whether partial updates are allowed, error conditions, or rate limits. The return format is mentioned but lacks detail.

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 with clear sections for Args and Returns. The opening sentence is front-loaded with the core purpose. Some minor verbosity exists in listing all parameter details that could be inferred from schema, but overall structure is efficient.

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 4 parameters with 0% schema coverage and no annotations, the description does well on parameter semantics but lacks behavioral context for a mutation tool. The presence of an output schema reduces need to explain return values, but more guidance on usage and transparency would improve completeness.

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?

Schema description coverage is 0%, so the description must compensate. It provides clear semantic explanations for all 4 parameters: memo_uid identifies the target, content is new text, visibility has enumerated values, and pinned controls pinning status. This adds significant value beyond the bare schema.

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 verb 'update' and resource 'memo', making the purpose immediately understandable. However, it doesn't differentiate this tool from its sibling 'create_memo' beyond the obvious difference in operation type, missing explicit comparison.

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 like 'create_memo' or 'get_memo'. The description simply states what the tool does without context about appropriate use cases or prerequisites.

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