delete_list_item
Remove a specific item from a Google Keep checklist using its note and item IDs.
Instructions
Delete a checklist item.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note_id | Yes | ||
| item_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/server/cli.py:156-171 (handler)The tool handler implementation for delete_list_item. Registered via @mcp.tool() decorator. Gets the note, validates it's modifiable and is a list type, finds the item by ID, calls item.delete(), syncs with Keep API, and returns a JSON message.
@mcp.tool() def delete_list_item(note_id: str, item_id: str) -> str: """Delete a checklist item.""" keep, note = _get_note_or_raise(note_id) _ensure_modifiable(note) if not isinstance(note, gkeepapi.node.List): raise ValueError(f"Note with ID {note_id} is not a list") item = note.get(item_id) if not item: raise ValueError(f"List item with ID {item_id} not found") item.delete() keep.sync() return json.dumps({"message": f"List item {item_id} marked for deletion"}) - src/server/cli.py:156-156 (registration)The @mcp.tool() decorator registers delete_list_item as an MCP tool on the FastMCP server instance.
@mcp.tool() - src/server/cli.py:157-157 (schema)Input schema: accepts note_id (str) and item_id (str). Returns a JSON string with a message field.
def delete_list_item(note_id: str, item_id: str) -> str: - src/server/cli.py:17-22 (helper)Helper function used by delete_list_item to fetch the note by ID or raise ValueError.
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 delete_list_item to ensure the note can be modified before deleting an item.
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)" )