update_note
Modify Google Keep notes by updating their title or text content via the Keep MCP server. Requires the note ID and supports optional fields for title and text changes.
Instructions
Update a note's properties.
Args:
note_id (str): The ID of the note to update
title (str, optional): New title for the note
text (str, optional): New text content for the note
Returns:
str: JSON string containing the updated note's data
Raises:
ValueError: If the note doesn't exist or cannot be modified
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note_id | Yes | ||
| text | No | ||
| title | No |
Implementation Reference
- src/server/cli.py:55-55 (registration)The @mcp.tool() decorator registers the update_note tool with the FastMCP server.@mcp.tool()
- src/server/cli.py:56-86 (handler)The handler function for the 'update_note' tool. Retrieves the note by ID using the Google Keep client, performs modification checks, updates title and/or text as provided, syncs changes, and returns serialized JSON of the updated note.def update_note(note_id: str, title: str = None, text: str = None) -> str: """ Update a note's properties. Args: note_id (str): The ID of the note to update title (str, optional): New title for the note text (str, optional): New text content for the note Returns: str: JSON string containing the updated note's data Raises: ValueError: If the note doesn't exist or cannot be modified """ keep = get_client() note = keep.get(note_id) if not note: raise ValueError(f"Note with ID {note_id} not found") if not can_modify_note(note): raise ValueError(f"Note with ID {note_id} cannot be modified (missing keep-mcp label and UNSAFE_MODE is not enabled)") if title is not None: note.title = title if text is not None: note.text = text keep.sync() # Ensure changes are saved to the server return json.dumps(serialize_note(note))
- src/server/cli.py:56-70 (schema)The function signature and docstring define the input schema (parameters: note_id required str, title/text optional str) and output (str JSON), which is used by FastMCP for tool schema.def update_note(note_id: str, title: str = None, text: str = None) -> str: """ Update a note's properties. Args: note_id (str): The ID of the note to update title (str, optional): New title for the note text (str, optional): New text content for the note Returns: str: JSON string containing the updated note's data Raises: ValueError: If the note doesn't exist or cannot be modified """