-
Notifications
You must be signed in to change notification settings - Fork 3.3k
feat(tools): added more intercom tools #3022
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No files reviewed, no comments
a0cfa60 to
baa6fbc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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