Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • added more intercom tools

Type of Change

  • New Feature

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Jan 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
docs Ready Ready Preview, Comment Jan 27, 2026 5:40am

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 27, 2026

Greptile Overview

Greptile Summary

Added 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.

  • New Tools: assign_conversation, close_conversation, open_conversation, snooze_conversation, tag_contact, untag_contact, tag_conversation, create_tag, list_tags, list_admins, create_note, create_event, update_ticket, attach_contact_to_company, detach_contact_from_company
  • Block Configuration: Extended IntercomBlock with 15 new operations, proper field mappings, and AI-powered wand prompts for timestamp and JSON generation
  • Documentation: Added comprehensive API documentation for all new tools with input/output specifications
  • Code Quality: All tools follow established patterns with proper error handling via handleIntercomError, consistent API versioning (2.14), and appropriate parameter visibility (user-only for access tokens)
  • Minor Refactor: Simplified execution snapshot component by removing unnecessary ref tracking

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • All new tools follow established architectural patterns, include proper error handling, use correct visibility settings for credentials, and are well-documented. The code is clean, consistent, and adds valuable functionality without breaking changes.
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/tools/intercom/assign_conversation.ts New tool to assign conversations to admins/teams with proper error handling and response transformation
apps/sim/tools/intercom/create_event.ts New tool to track custom events with metadata support and JSON parsing error handling
apps/sim/tools/intercom/update_ticket.ts New tool to update ticket state, attributes, and assignment with JSON parsing and error handling
apps/sim/blocks/blocks/intercom.ts Updated block config to support 15 new operations with proper field mappings, AI prompts, and parameter handling
apps/sim/tools/intercom/index.ts Updated exports to include all new intercom tool modules
apps/sim/tools/registry.ts Registered 15 new intercom v2 tools in the global tool registry
apps/docs/content/docs/en/tools/intercom.mdx Added comprehensive documentation for all new intercom tools with input/output specifications

Sequence Diagram

sequenceDiagram
    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
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a 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

Edit Code Review Agent Settings | Greptile

@waleedlatif1 waleedlatif1 merged commit 46ba315 into staging Jan 27, 2026
7 checks passed
@waleedlatif1 waleedlatif1 deleted the feat/tools branch January 27, 2026 05:41
Copy link

@cursor cursor bot left a 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,
}),
Copy link

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.

Fix in Cursor Fix in Web

})

return cleanParams
},
Copy link

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)

Fix in Cursor Fix in Web

if (event_metadata) cleanParams.metadata = event_metadata
if (event_created_at) cleanParams.created_at = Number(event_created_at)
}

Copy link

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.

Additional Locations (1)

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants