add_note_collaborator
Add a collaborator email to a Google Keep note using the note ID and email address.
Instructions
Add a collaborator email to a note.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note_id | Yes | ||
| Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/server/cli.py:346-354 (handler)The tool handler for add_note_collaborator. It gets the note via _get_note_or_raise, ensures modifiability, adds the collaborator email, syncs, and returns the serialized note.
@mcp.tool() def add_note_collaborator(note_id: str, email: str) -> str: """Add a collaborator email to a note.""" keep, note = _get_note_or_raise(note_id) _ensure_modifiable(note) note.collaborators.add(email) keep.sync() return json.dumps(serialize_note(note)) - src/server/cli.py:346-347 (registration)Registration via the @mcp.tool() decorator on the add_note_collaborator function. The function name is the tool name.
@mcp.tool() def add_note_collaborator(note_id: str, email: str) -> str: - src/server/cli.py:347-347 (schema)Input schema is defined implicitly by the function signature: note_id (str) and email (str).
def add_note_collaborator(note_id: str, email: str) -> str: - src/server/cli.py:17-22 (helper)_get_note_or_raise helper used by the handler to retrieve the note 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)_ensure_modifiable helper used by the handler to check if the note can be modified.
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)" )