create_list
Create a checklist note in Google Keep with optional title and items. Each item includes a task and its checked status.
Instructions
Create a new checklist note.
items should be objects like: {"text": "task", "checked": false}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | No | ||
| items | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/server/cli.py:95-117 (handler)The MCP tool handler for create_list: creates a new checklist note with optional items, adds the keep-mcp label, syncs, and returns serialized JSON.
@mcp.tool() def create_list(title: str | None = None, items: list[dict[str, Any]] | None = None) -> str: """ Create a new checklist note. items should be objects like: {"text": "task", "checked": false} """ keep = get_client() formatted_items = None if items: formatted_items = [ (item.get("text", ""), bool(item.get("checked", False))) for item in items ] note = keep.createList(title=title, items=formatted_items) label = keep.findLabel("keep-mcp") if not label: label = keep.createLabel("keep-mcp") note.labels.add(label) keep.sync() return json.dumps(serialize_note(note)) - src/server/cli.py:95-96 (registration)Registration of create_list as an MCP tool via the @mcp.tool() decorator on line 95.
@mcp.tool() def create_list(title: str | None = None, items: list[dict[str, Any]] | None = None) -> str: - src/server/cli.py:96-100 (schema)Type signature and docstring defining the input schema: optional title (str) and items (list of dicts with text/checked fields), returns JSON string.
def create_list(title: str | None = None, items: list[dict[str, Any]] | None = None) -> str: """ Create a new checklist note. items should be objects like: {"text": "task", "checked": false} - src/server/keep_api.py:62-68 (helper)Helper function serialize_list_item used to convert checklist items into dictionaries for the JSON response.
def serialize_list_item(item): return { 'id': item.id, 'text': item.text, 'checked': item.checked, 'parent_item_id': item.parent_item.id if item.parent_item else None, } - src/server/keep_api.py:71-105 (helper)Helper function serialize_note used to serialize the created list note into a JSON-serializable dictionary, including items via serialize_list_item.
def serialize_note(note): """ Serialize a Google Keep note into a dictionary. Args: note: A Google Keep note object Returns: dict: A dictionary containing the note's id, title, text, pinned status, color and labels """ payload = { 'id': note.id, 'title': note.title, 'text': note.text, 'type': note.type.value, 'pinned': note.pinned, 'archived': note.archived, 'trashed': note.trashed, 'color': note.color.value if note.color else None, 'labels': [serialize_label(label) for label in note.labels.all()], 'collaborators': list(note.collaborators.all()), } if hasattr(note, 'items'): payload['items'] = [serialize_list_item(item) for item in note.items] payload['media'] = [ { 'blob_id': blob.id, 'type': blob.blob.type.value if blob.blob and blob.blob.type else None, } for blob in note.blobs ] return payload