add_comment
Creates a new comment thread + first message. anchor.type depends on the context: 'cell' / 'entity_field' / 'dependency' / 'field_relation' / 'content_block' to pin to a specific diagram element; 'free' for a note floating freely on the canvas (pinX and pinY are then required — the coordinates are retrieved via list_cells or inferred from context, e.g. an empty area next to the relevant block); 'document_range' to comment on a rich DOCUMENT (documentId is then required, and nothing else — the targeted text range is marked in the document by the interface, not by this anchor); 'task' to discuss a TASK (taskId is then required, and nothing else — no cellId: the block of a task can change without touching the thread). The task must exist in the active project (named refusal otherwise). A task thread survives its task (there is never a cascade): list_comments marks it orphaned:true when the task has disappeared.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | Text of the first message (plain text, rendered as written) | |
| pinX | No | Pin X coordinate — REQUIRED if anchor.type=free (visual override otherwise) | |
| pinY | No | Pin Y coordinate — REQUIRED if anchor.type=free (visual override otherwise) | |
| anchor | Yes | Comment anchor (cell / entity_field / dependency / field_relation / content_block / free / document_range / task) | |
| mentions | No | IDs of the mentioned users (max 20). Only those with REAL access to this project are notified; the others are silently dropped (no row created) and named in `warning`. | |
| expectedProjectId | No | UUID of the project targeted by THIS call. ACTUALLY targets this project instead of the session project. Refused without changing anything if access is not granted. |