MCP Tool: create_comment

Add a new comment to any entity in the Thena platform. This tool allows you to create comments with various content types, visibility settings, and threading capabilities.

Example Prompt

Create a comment on ticket 71XNF90K10YBR86G1AN06KZJJFX40 with content "Customer reported an issue"

Input Parameters

NameTypeRequiredDescription
entityTypestringYesThe type of entity to comment on (e.g., “ticket”, “accountActivity”, “note”, “task”)
entityIdstringYesThe ID of the entity to comment on
contentstringNoThe plain text content of the comment
contentHtmlstringNoThe HTML content of the comment
contentJsonstringNoThe JSON content of the comment (for rich text editors, etc.)
parentCommentIdstringNoThe ID of the parent comment (for threaded comments)
commentVisibilityenumNo”public” or “private” (default: “public”)
commentTypestringNo”note”, “reply”, “comment”, etc. (default: “comment”)
threadNamestringNoThe name of the comment thread (for grouping)
metadataobjectNoAny additional metadata (e.g., mentions, tags)
attachmentIdsstring[]NoArray of attachment IDs to associate with the comment
customerEmailstringNoThe email of the customer (if commenting as a customer)
impersonatedUserEmailstringNoIf impersonating a user, their email
impersonatedUserNamestringNoIf impersonating a user, their name
impersonatedUserAvatarstringNoIf impersonating a user, their avatar URL

Content Types

You can provide comment content in multiple formats:

Plain Text

{
  "entityType": "ticket",
  "entityId": "ticket_123",
  "content": "This is a simple text comment"
}

HTML Content

{
  "entityType": "ticket",
  "entityId": "ticket_123",
  "contentHtml": "<p>This is an <strong>HTML formatted</strong> comment</p>"
}

JSON Content (Rich Text)

{
  "entityType": "ticket",
  "entityId": "ticket_123",
  "contentJson": "{\"blocks\":[{\"text\":\"Rich text content\",\"type\":\"paragraph\"}]}"
}

Visibility Settings

Public Comment (Default)

{
  "entityType": "ticket",
  "entityId": "ticket_123",
  "content": "This comment is visible to customers",
  "commentVisibility": "public"
}

Private Comment

{
  "entityType": "ticket",
  "entityId": "ticket_123",
  "content": "This is an internal note only visible to team members",
  "commentVisibility": "private"
}

Threaded Comments

Create a reply to an existing comment:
{
  "entityType": "ticket",
  "entityId": "ticket_123",
  "content": "This is a reply to the parent comment",
  "parentCommentId": "comment_456"
}

Comment Types

Different comment types serve different purposes:
  • comment - General comment (default)
  • note - Internal note
  • reply - Reply to another comment
  • status_update - Status change notification
  • assignment - Assignment notification

Examples

Basic Ticket Comment

{
  "entityType": "ticket",
  "entityId": "ticket_123",
  "content": "Customer reported the issue. Investigating now.",
  "commentType": "note",
  "commentVisibility": "private"
}

Public Customer Response

{
  "entityType": "ticket",
  "entityId": "ticket_123",
  "content": "Thank you for reporting this issue. We're working on a fix.",
  "commentVisibility": "public"
}

Comment with Attachments

{
  "entityType": "ticket",
  "entityId": "ticket_123",
  "content": "Screenshot of the error attached",
  "attachmentIds": ["att_789", "att_790"]
}

Impersonated User Comment

{
  "entityType": "ticket",
  "entityId": "ticket_123",
  "content": "Comment from support team",
  "impersonatedUserEmail": "support@company.com",
  "impersonatedUserName": "Support Team",
  "impersonatedUserAvatar": "https://example.com/avatar.png"
}

Response Fields

Below are the fields you may see in the response:
FieldTypeDescription
idstringComment unique ID
contentstringPlain text content of the comment
contentHtmlstringHTML formatted content
contentMarkdownstringMarkdown formatted content
contentJsonstringJSON formatted content for rich text
isEditedbooleanWhether the comment has been edited
threadNamestringName of the comment thread
commentVisibilitystringVisibility setting (public or private)
commentTypestringType of comment (note, reply, comment, etc.)
isPinnedbooleanWhether the comment is pinned
sourceEmailIdstringEmail ID if comment came from email
metadataobjectAdditional metadata including mentions
createdAtstring (ISO8601)Creation timestamp
updatedAtstring (ISO8601)Last update timestamp
authorstringAuthor display name
authorAvatarUrlstringAuthor’s avatar URL
attachmentsarrayArray of attachment IDs
authorIdstringAuthor’s user ID
authorUserTypestringAuthor’s user type (e.g., ORG_ADMIN)
impersonatedUserEmailstringEmail of impersonated user
impersonatedUserNamestringName of impersonated user
impersonatedUserAvatarstringAvatar of impersonated user
deletedAtstringDeletion timestamp (null if not deleted)

Sample Response

{
  "data": {
    "id": "S5Q6R01K1052NAMN8YGYHYGKZG082",
    "content": "hey, this is a test comment",
    "contentHtml": "",
    "contentMarkdown": "hey, this is a test comment",
    "contentJson": "{\"type\":\"doc\",\"content\":[{\"type\":\"paragraph\",\"attrs\":{\"textAlign\":\"left\"}}]}",
    "isEdited": false,
    "threadName": null,
    "commentVisibility": "private",
    "commentType": "comment",
    "isPinned": false,
    "sourceEmailId": null,
    "metadata": {
      "mentions": []
    },
    "createdAt": "2025-07-25T12:16:24.755Z",
    "updatedAt": "2025-07-25T12:16:24.754Z",
    "author": "shakthi+1",
    "authorAvatarUrl": null,
    "attachments": [],
    "authorId": "UTH00SEXXFNVVN",
    "authorUserType": "ORG_ADMIN",
    "impersonatedUserEmail": null,
    "impersonatedUserName": null,
    "impersonatedUserAvatar": null,
    "deletedAt": null
  },
  "status": true,
  "message": "Comment created successfully!",
  "timestamp": "2025-07-25T12:16:24.780Z"
}

Error Handling

Common error scenarios:
  • Invalid entity type or ID
  • Missing required content
  • Invalid attachment IDs
  • Permission denied for the entity
  • Network or authentication errors