feat(tools): added more intercom tools#3022
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
74156ab to
a0cfa60
Compare
Greptile OverviewGreptile SummaryAdded 15 new Intercom tools for comprehensive customer support workflows including conversation management (assign, close, open, snooze), tagging (contacts, conversations, create/list tags), ticket updates, admin listing, note creation, event tracking, and company-contact associations.
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant IntercomBlock
participant ToolRegistry
participant IntercomAPI
User->>IntercomBlock: Select operation (e.g., "assign_conversation")
User->>IntercomBlock: Provide parameters (conversationId, admin_id, assignee_id, etc.)
IntercomBlock->>IntercomBlock: Map UI fields to tool params<br/>(e.g., tag_contact_id → contactId)
IntercomBlock->>IntercomBlock: Select appropriate tool version<br/>(e.g., intercom_assign_conversation_v2)
IntercomBlock->>ToolRegistry: Request tool execution
ToolRegistry->>ToolRegistry: Lookup tool config by ID
ToolRegistry->>IntercomAPI: POST /conversations/{id}/parts<br/>with Authorization header
alt Success (200 OK)
IntercomAPI-->>ToolRegistry: Return conversation data
ToolRegistry->>ToolRegistry: Transform response via transformResponse()
ToolRegistry-->>IntercomBlock: Return structured output
IntercomBlock-->>User: Display success with conversation details
else Error (4xx/5xx)
IntercomAPI-->>ToolRegistry: Return error response
ToolRegistry->>ToolRegistry: Call handleIntercomError()
ToolRegistry-->>IntercomBlock: Throw formatted error
IntercomBlock-->>User: Display error message
end
|
a0cfa60 to
baa6fbc
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| message_type: 'snoozed', | ||
| admin_id: params.admin_id, | ||
| snoozed_until: params.snoozed_until, | ||
| }), |
There was a problem hiding this comment.
Snooze conversation missing required type field
Medium Severity
The snooze_conversation request body is missing type: 'admin' field that all other conversation management operations include. Looking at close_conversation, open_conversation, assign_conversation, and reply_conversation, they all include type: 'admin' in their body payload. The snooze body only has message_type, admin_id, and snoozed_until but lacks the type field. This inconsistency could cause the Intercom API to reject the request or behave unexpectedly.
| }) | ||
|
|
||
| return cleanParams | ||
| }, |
There was a problem hiding this comment.
Duplicated params function in IntercomV2Block
Low Severity
The params function in IntercomV2Block.tools.config is a complete duplicate (~150 lines) of the same function in IntercomBlock.tools.config. Previously, IntercomV2Block shared the function via params: IntercomBlock.tools!.config!.params. Now both blocks maintain identical copies of complex field mapping logic, which increases maintenance burden and risks inconsistent bug fixes across the two implementations.
Additional Locations (1)
| if (event_metadata) cleanParams.metadata = event_metadata | ||
| if (event_created_at) cleanParams.created_at = Number(event_created_at) | ||
| } | ||
|
|
There was a problem hiding this comment.
Missing number conversion for snooze_conversation timestamp
Medium Severity
The snoozed_until field for snooze_conversation operation passes through the params function as a string without being converted to a number. The block field is a short-input (string type), but the tool expects a number. Other timestamp fields like ticket_snoozed_until, event_created_at, and reply_created_at are explicitly converted using Number(), but snoozed_until is not destructured and passes through via ...rest unconverted. This will cause the Intercom API to receive a string instead of a Unix timestamp number.
Summary
Type of Change
Testing
Tested manually
Checklist