Skip to main content
Glama

update_memo

Modify existing memos by updating content, changing visibility settings, or pinning important notes in the Memos knowledge management system.

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

NameRequiredDescriptionDefault
memo_uidYes
contentNo
visibilityNo
pinnedNo

Input Schema (JSON Schema)

{ "properties": { "content": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null }, "memo_uid": { "type": "string" }, "pinned": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null }, "visibility": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null } }, "required": [ "memo_uid" ], "type": "object" }

Implementation Reference

  • The core handler function for the 'update_memo' tool. It is decorated with @mcp.tool(), which registers it with the MCP server and defines its schema via the function signature and docstring. The function performs a PATCH request to the Memos API to update the specified memo's content, visibility, or pinned status.
    @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)}"

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