archive_note
Archive or unarchive a Google Keep note by providing its ID and setting the archived status.
Instructions
Archive or unarchive a note.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note_id | Yes | ||
| archived | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/server/cli.py:215-223 (handler)The MCP tool handler for 'archive_note'. Gets the note by ID, ensures it is modifiable, sets the archived flag, syncs with Google Keep, and returns the serialized note as JSON.
@mcp.tool() def archive_note(note_id: str, archived: bool = True) -> str: """Archive or unarchive a note.""" keep, note = _get_note_or_raise(note_id) _ensure_modifiable(note) note.archived = archived keep.sync() return json.dumps(serialize_note(note)) - src/server/cli.py:215-216 (registration)The @mcp.tool() decorator registers 'archive_note' as an MCP tool with FastMCP.
@mcp.tool() def archive_note(note_id: str, archived: bool = True) -> str: - src/server/cli.py:17-22 (helper)Helper function used by archive_note to retrieve the note by ID, raising an error if not found.
def _get_note_or_raise(note_id: str): keep = get_client() note = keep.get(note_id) if not note: raise ValueError(f"Note with ID {note_id} not found") return keep, note - src/server/cli.py:25-30 (helper)Helper function used by archive_note to ensure the note can be modified before archiving.
def _ensure_modifiable(note): 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)" )