# add_comment

Source: https://heyeveryone.ai/docs/mcp/add_comment

> Leave a comment on content: the whole item (`target: piece`), the original draft (`master`) or one post (`post` with `postId`). For specific words pass `anchor`: `{ quote }` (the exact text; its first occurrence is used) or `{ start, end }` character offsets, plus `segmentIndex` for a thread segment (default 0). The quoted text and content version are stored, so when the text later changes the comment shows as outdated instead of disappearing. Reply with `parentCommentId` (a reply takes its parent's target). To @mention teammates, pass their account ids in `mentions` (from list_members) and write `@Name` in the body; each gets a notification. Resolve with resolve_comment.

Leave a comment on content: the whole item (`target: piece`), the original draft (`master`) or one post (`post` with `postId`). For specific words pass `anchor`: `{ quote }` (the exact text; its first occurrence is used) or `{ start, end }` character offsets, plus `segmentIndex` for a thread segment (default 0). The quoted text and content version are stored, so when the text later changes the comment shows as outdated instead of disappearing. Reply with `parentCommentId` (a reply takes its parent's target). To @mention teammates, pass their account ids in `mentions` (from list_members) and write `@Name` in the body; each gets a notification. Resolve with resolve_comment.

## Access and cost

- Kind: mutation
- Scope: workspace
- Actors: member, agent
- Credits: Free
- Requires confirmation: false
- Accepts idempotency key: false

## Input schema

```json
{
  "properties": {
    "workspaceId": {
      "format": "uuid",
      "type": "string"
    },
    "pieceId": {
      "format": "uuid",
      "type": "string"
    },
    "target": {
      "default": "piece",
      "enum": [
        "piece",
        "master",
        "post"
      ],
      "type": "string"
    },
    "postId": {
      "format": "uuid",
      "type": "string"
    },
    "segmentIndex": {
      "minimum": 0,
      "type": "integer"
    },
    "anchor": {
      "anyOf": [
        {
          "properties": {
            "start": {
              "minimum": 0,
              "type": "integer"
            },
            "end": {
              "minimum": 1,
              "type": "integer"
            }
          },
          "required": [
            "start",
            "end"
          ],
          "type": "object"
        },
        {
          "properties": {
            "quote": {
              "maxLength": 5000,
              "minLength": 1,
              "type": "string"
            }
          },
          "required": [
            "quote"
          ],
          "type": "object"
        }
      ]
    },
    "parentCommentId": {
      "format": "uuid",
      "type": "string"
    },
    "body": {
      "minLength": 1,
      "type": "string"
    },
    "mentions": {
      "items": {
        "format": "uuid",
        "type": "string"
      },
      "maxItems": 20,
      "type": "array"
    }
  },
  "required": [
    "workspaceId",
    "pieceId",
    "body"
  ],
  "type": "object"
}
```

## Output schema

```json
{
  "additionalProperties": false,
  "properties": {
    "comment": {
      "additionalProperties": false,
      "properties": {
        "id": {
          "format": "uuid",
          "type": "string"
        },
        "workspaceId": {
          "format": "uuid",
          "type": "string"
        },
        "pieceId": {
          "format": "uuid",
          "type": "string"
        },
        "target": {
          "enum": [
            "piece",
            "master",
            "post"
          ],
          "type": "string"
        },
        "postId": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "segmentIndex": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "rangeStart": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "rangeEnd": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "quotedText": {
          "type": [
            "string",
            "null"
          ]
        },
        "anchorVersion": {
          "anyOf": [
            {
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "parentCommentId": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "body": {
          "type": "string"
        },
        "authorKind": {
          "enum": [
            "member",
            "guest",
            "agent"
          ],
          "type": "string"
        },
        "authorAccountId": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "authorGuestId": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "authorAgentClientId": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "resolvedAt": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "resolvedByAccountId": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "createdAt": {
          "format": "date-time",
          "type": "string"
        },
        "updatedAt": {
          "format": "date-time",
          "type": "string"
        },
        "author": {
          "additionalProperties": false,
          "properties": {
            "kind": {
              "enum": [
                "member",
                "guest",
                "agent",
                "system"
              ],
              "type": "string"
            },
            "accountId": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "agentClientId": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "guestId": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "name": {
              "type": "string"
            }
          },
          "required": [
            "kind",
            "accountId",
            "agentClientId",
            "guestId",
            "name"
          ],
          "type": "object"
        },
        "anchorStatus": {
          "enum": [
            "whole",
            "current",
            "moved",
            "outdated"
          ],
          "type": "string"
        },
        "outdated": {
          "type": "boolean"
        },
        "currentRange": {
          "anyOf": [
            {
              "additionalProperties": false,
              "properties": {
                "start": {
                  "minimum": 0,
                  "type": "integer"
                },
                "end": {
                  "minimum": 0,
                  "type": "integer"
                }
              },
              "required": [
                "start",
                "end"
              ],
              "type": "object"
            },
            {
              "type": "null"
            }
          ]
        },
        "mentions": {
          "items": {
            "additionalProperties": false,
            "properties": {
              "accountId": {
                "format": "uuid",
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "accountId",
              "name"
            ],
            "type": "object"
          },
          "type": "array"
        }
      },
      "required": [
        "id",
        "workspaceId",
        "pieceId",
        "target",
        "postId",
        "segmentIndex",
        "rangeStart",
        "rangeEnd",
        "quotedText",
        "anchorVersion",
        "parentCommentId",
        "body",
        "authorKind",
        "authorAccountId",
        "authorGuestId",
        "authorAgentClientId",
        "resolvedAt",
        "resolvedByAccountId",
        "createdAt",
        "updatedAt",
        "author",
        "anchorStatus",
        "outdated",
        "currentRange",
        "mentions"
      ],
      "type": "object"
    }
  },
  "required": [
    "comment"
  ],
  "type": "object"
}
```

## Errors

```json
[
  "anchor_not_found"
]
```

## Annotations

```json
{
  "destructiveHint": false,
  "idempotentHint": false,
  "openWorldHint": false,
  "readOnlyHint": false,
  "title": "Comment on content"
}
```
