> ## Documentation Index
> Fetch the complete documentation index at: https://docs.thena.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get comments by user type

> MCP tool to filter comments by user type in the Thena platform.

import Admonition from '@theme/Admonition';

### MCP tool: `get_comments_by_user_type`

Retrieves comments filtered by user type (internal/external) for a specific entity. Useful for separating internal team comments from customer-facing comments.

<Admonition type="note">
  You must provide the user type, entity type, and entity ID to filter comments.
</Admonition>

### Example prompt

```prompt theme={null}
Get internal comments for ticket 71XNF90K10YBR86G1AN06KZJJFX40
```

<Admonition type="info">
  When you use this prompt in a chat with the model (with the MCP tool registered), the model will automatically call the <code>get\_comments\_by\_user\_type</code> tool with the correct arguments.
</Admonition>

### Input parameters

| Name       | Type   | Required | Description                                                      |
| ---------- | ------ | -------- | ---------------------------------------------------------------- |
| userType   | string | Yes      | The type of user to filter comments by                           |
| entityType | string | Yes      | The type of entity to filter comments by (e.g., ticket, account) |
| entityId   | string | Yes      | The ID of the entity to filter comments by                       |

### User types

Common user types include:

* `internal` - Team members and internal users
* `external` - Customers and external users
* `agent` - Support agents
* `customer` - End customers

### Response fields

Below are the fields you may see in the response:

<table>
  <thead>
    <tr>
      <th>Field</th>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr><td>id</td><td>string</td><td>Comment unique ID</td></tr>
    <tr><td>content</td><td>string</td><td>Plain text content of the comment</td></tr>
    <tr><td>contentHtml</td><td>string</td><td>HTML formatted content</td></tr>
    <tr><td>contentMarkdown</td><td>string</td><td>Markdown formatted content</td></tr>
    <tr><td>contentJson</td><td>string</td><td>JSON formatted content for rich text</td></tr>
    <tr><td>isEdited</td><td>boolean</td><td>Whether the comment has been edited</td></tr>
    <tr><td>threadName</td><td>string</td><td>Name of the comment thread</td></tr>
    <tr><td>commentVisibility</td><td>string</td><td>Visibility setting (public or private)</td></tr>
    <tr><td>commentType</td><td>string</td><td>Type of comment (note, reply, comment, etc.)</td></tr>
    <tr><td>isPinned</td><td>boolean</td><td>Whether the comment is pinned</td></tr>
    <tr><td>sourceEmailId</td><td>string</td><td>Email ID if comment came from email</td></tr>
    <tr><td>metadata</td><td>object</td><td>Additional metadata including mentions</td></tr>
    <tr><td>createdAt</td><td>string (ISO8601)</td><td>Creation timestamp</td></tr>
    <tr><td>updatedAt</td><td>string (ISO8601)</td><td>Last update timestamp</td></tr>
    <tr><td>author</td><td>string</td><td>Author display name</td></tr>
    <tr><td>authorAvatarUrl</td><td>string</td><td>Author's avatar URL</td></tr>
    <tr><td>authorId</td><td>string</td><td>Author's user ID</td></tr>
    <tr><td>authorUserType</td><td>string</td><td>Author's user type (e.g., ORG\_ADMIN)</td></tr>
    <tr><td>impersonatedUserEmail</td><td>string</td><td>Email of impersonated user</td></tr>
    <tr><td>impersonatedUserName</td><td>string</td><td>Name of impersonated user</td></tr>
    <tr><td>impersonatedUserAvatar</td><td>string</td><td>Avatar of impersonated user</td></tr>
    <tr><td>deletedAt</td><td>string</td><td>Deletion timestamp (null if not deleted)</td></tr>
  </tbody>
</table>

### Sample response

```json theme={null}
{
  "data": {
    "id": "X66KS01K10E5FVTJK7ZVRW3AKVYDD",
    "content": "this is a reply",
    "contentHtml": "<p>this is a reply</p>",
    "contentMarkdown": "this is a reply",
    "contentJson": "\"{\\"type\\":\\"doc\\",\\"content\\":[{\\"type\\":\\"paragraph\\",\\"attrs\\":{\\"textAlign\\":\\"left\\"},\\"content\\":[{\\"type\\":\\"text\\",\\"text\\":\\"this is a reply\\"}]}]}\"",
    "isEdited": false,
    "threadName": null,
    "commentVisibility": "public",
    "commentType": "comment",
    "isPinned": false,
    "sourceEmailId": null,
    "metadata": {
      "mentions": []
    },
    "createdAt": "2025-07-25T12:40:41.944Z",
    "updatedAt": "2025-07-25T12:40:41.941Z",
    "author": "shakthi+1",
    "authorAvatarUrl": null,
    "authorId": "UTH00SEXXFNVVN",
    "authorUserType": "ORG_ADMIN",
    "impersonatedUserEmail": null,
    "impersonatedUserName": null,
    "impersonatedUserAvatar": null,
    "deletedAt": null
  },
  "status": true,
  "message": "Comments fetched successfully!",
  "timestamp": "2025-07-25T12:50:38.937Z"
}
```

<Admonition type="tip">
  Always pass an object as input, even if empty, to avoid errors when calling the tool directly.
</Admonition>

***
