MCP Tool: search_comments

Searches for comments using Thena’s powerful search API with advanced filtering capabilities. This tool allows you to find comments based on various criteria including content, ticket UID, author, comment type, visibility, and other comment properties.

Example Prompt

Search for comments with "test" in their content

Response Fields

The response will contain a result object with the following structure:
FieldTypeDescription
foundnumberTotal number of comments found
hitsarrayArray of comment objects matching the search criteria
pagenumberCurrent page number
facet_countsarrayFacet counts for search results
request_paramsobjectParameters used for the search request
search_cutoffbooleanWhether the search was cut off due to limits

Comment Object Fields

Each comment in the hits array contains a document object with the following fields:
FieldTypeDescription
idstringComment unique identifier
contentstringComment content (main text)
contentHtmlstringHTML formatted content
contentMarkdownstringMarkdown formatted content
contentJsonstringJSON representation of content
isEditedbooleanWhether the comment was edited
threadNamestringComment thread name
commentVisibilitystringComment visibility (public, private)
commentTypestringType of comment (comment, reply, note)
isPinnedbooleanWhether the comment is pinned
sourceEmailIdstringSource email ID
metadataobjectComment metadata (mentions, userReactions, etc.)
createdAtstring (ISO8601)Comment creation timestamp
updatedAtstring (ISO8601)Last update timestamp
authorstringAuthor name
authorAvatarUrlstringAuthor avatar URL
attachmentsarrayComment attachments
authorIdstringAuthor’s user ID
authorUserTypestringAuthor’s user type
impersonatedUserEmailstringImpersonated user email
impersonatedUserNamestringImpersonated user name
impersonatedUserAvatarstringImpersonated user avatar
deletedAtstring (ISO8601)Deletion timestamp (if applicable)

Metadata Object Fields

The metadata object may contain:
FieldTypeDescription
mentionsarrayList of mentioned users
userReactionsarrayUser reactions to the comment
repliesarrayList of reply comment IDs
lastEditedAtstring (ISO8601)Last edit timestamp
lastEditedBystringUser who last edited the comment

Sample Response

{
  "result": {
    "found": 1,
    "hits": [
      {
        "document": {
          "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": [],
            "userReactions": []
          },
          "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
        }
      }
    ],
    "page": 1,
    "facet_counts": [],
    "request_params": {
      "search_mode": "fallback",
      "q": "*",
      "query_by": "content,content_markdown,content_html",
      "filter_by": "content:=test"
    },
    "search_cutoff": false
  }
}

Notes

  • Only authorized users can access this tool; results are scoped to the user’s organization.
  • The search API supports full-text search on comment content, markdown, and HTML using ILike pattern matching.
  • Comment UID searches require exact matches.
  • Filters can be combined using AND or OR logic for complex queries.
  • Date filters should use ISO 8601 format (e.g., “2025-07-25T12:16:24.755Z”).
  • Boolean filters use true/false values.
  • The search is case-insensitive for text fields.
  • Results are paginated with a maximum of 250 items per page.
  • Use the range operator for date ranges (e.g., “[2025-07-01..2025-07-31]”).
  • Related data (metadata, attachments, etc.) is included in the response but not searchable.