Skip to content

Commit 2a23bb8

Browse files
author
aadamgough
committed
fixed intercom
1 parent 133e75f commit 2a23bb8

16 files changed

+746
-107
lines changed

apps/sim/tools/intercom/create_company.ts

Lines changed: 73 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,33 @@ export interface IntercomCreateCompanyParams {
2020
export interface IntercomCreateCompanyResponse {
2121
success: boolean
2222
output: {
23-
company: any
23+
company: {
24+
id: string
25+
type: string
26+
app_id: string
27+
company_id: string
28+
name?: string
29+
website?: string
30+
plan: Record<string, any>
31+
size?: number
32+
industry?: string
33+
monthly_spend: number
34+
session_count: number
35+
user_count: number
36+
created_at: number
37+
updated_at: number
38+
remote_created_at?: number
39+
custom_attributes: Record<string, any>
40+
tags: {
41+
type: string
42+
tags: any[]
43+
}
44+
segments: {
45+
type: string
46+
segments: any[]
47+
}
48+
[key: string]: any
49+
}
2450
metadata: {
2551
operation: 'create_company'
2652
companyId: string
@@ -159,15 +185,55 @@ export const intercomCreateCompanyTool: ToolConfig<
159185
},
160186

161187
outputs: {
162-
success: { type: 'boolean', description: 'Operation success status' },
163-
output: {
188+
company: {
164189
type: 'object',
165-
description: 'Created or updated company data',
190+
description: 'Created or updated company object',
166191
properties: {
167-
company: { type: 'object', description: 'Company object' },
168-
metadata: { type: 'object', description: 'Operation metadata' },
169-
success: { type: 'boolean', description: 'Operation success' },
192+
id: { type: 'string', description: 'Unique identifier for the company' },
193+
type: { type: 'string', description: 'Object type (company)' },
194+
app_id: { type: 'string', description: 'Intercom app ID' },
195+
company_id: { type: 'string', description: 'Your unique identifier for the company' },
196+
name: { type: 'string', description: 'Name of the company' },
197+
website: { type: 'string', description: 'Company website URL' },
198+
plan: { type: 'object', description: 'Company plan information' },
199+
size: { type: 'number', description: 'Number of employees' },
200+
industry: { type: 'string', description: 'Industry the company operates in' },
201+
monthly_spend: { type: 'number', description: 'Monthly revenue from this company' },
202+
session_count: { type: 'number', description: 'Number of sessions' },
203+
user_count: { type: 'number', description: 'Number of users in the company' },
204+
created_at: { type: 'number', description: 'Unix timestamp when company was created' },
205+
updated_at: { type: 'number', description: 'Unix timestamp when company was last updated' },
206+
remote_created_at: {
207+
type: 'number',
208+
description: 'Unix timestamp when company was created by you',
209+
},
210+
custom_attributes: { type: 'object', description: 'Custom attributes set on the company' },
211+
tags: {
212+
type: 'object',
213+
description: 'Tags associated with the company',
214+
properties: {
215+
type: { type: 'string', description: 'Tag list type' },
216+
tags: { type: 'array', description: 'Array of tag objects' },
217+
},
218+
},
219+
segments: {
220+
type: 'object',
221+
description: 'Segments the company belongs to',
222+
properties: {
223+
type: { type: 'string', description: 'Segment list type' },
224+
segments: { type: 'array', description: 'Array of segment objects' },
225+
},
226+
},
170227
},
171228
},
229+
metadata: {
230+
type: 'object',
231+
description: 'Operation metadata',
232+
properties: {
233+
operation: { type: 'string', description: 'The operation performed (create_company)' },
234+
companyId: { type: 'string', description: 'ID of the created/updated company' },
235+
},
236+
},
237+
success: { type: 'boolean', description: 'Operation success status' },
172238
},
173239
}

apps/sim/tools/intercom/create_contact.ts

Lines changed: 135 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,58 @@ export interface IntercomCreateContactParams {
2323
export interface IntercomCreateContactResponse {
2424
success: boolean
2525
output: {
26-
contact: any
26+
contact: {
27+
id: string
28+
type: string
29+
role: string
30+
email: string | null
31+
phone: string | null
32+
name: string | null
33+
avatar: string | null
34+
owner_id: string | null
35+
external_id: string | null
36+
created_at: number
37+
updated_at: number
38+
signed_up_at: number | null
39+
last_seen_at: number | null
40+
workspace_id: string
41+
custom_attributes: Record<string, any>
42+
tags: {
43+
type: string
44+
url: string
45+
data: any[]
46+
has_more: boolean
47+
total_count: number
48+
}
49+
notes: {
50+
type: string
51+
url: string
52+
data: any[]
53+
has_more: boolean
54+
total_count: number
55+
}
56+
companies: {
57+
type: string
58+
url: string
59+
data: any[]
60+
has_more: boolean
61+
total_count: number
62+
}
63+
location: {
64+
type: string
65+
city: string | null
66+
region: string | null
67+
country: string | null
68+
country_code: string | null
69+
continent_code: string | null
70+
}
71+
social_profiles: {
72+
type: string
73+
data: any[]
74+
}
75+
unsubscribed_from_emails: boolean
76+
[key: string]: any
77+
}
2778
metadata: {
2879
operation: 'create_contact'
2980
contactId: string
@@ -182,15 +233,92 @@ export const intercomCreateContactTool: ToolConfig<
182233
},
183234

184235
outputs: {
185-
success: { type: 'boolean', description: 'Operation success status' },
186-
output: {
236+
contact: {
187237
type: 'object',
188-
description: 'Created contact data',
238+
description: 'Created contact object',
189239
properties: {
190-
contact: { type: 'object', description: 'Created contact object' },
191-
metadata: { type: 'object', description: 'Operation metadata' },
192-
success: { type: 'boolean', description: 'Operation success' },
240+
id: { type: 'string', description: 'Unique identifier for the contact' },
241+
type: { type: 'string', description: 'Object type (contact)' },
242+
role: { type: 'string', description: 'Role of the contact (user or lead)' },
243+
email: { type: 'string', description: 'Email address of the contact' },
244+
phone: { type: 'string', description: 'Phone number of the contact' },
245+
name: { type: 'string', description: 'Name of the contact' },
246+
avatar: { type: 'string', description: 'Avatar URL of the contact' },
247+
owner_id: { type: 'string', description: 'ID of the admin assigned to this contact' },
248+
external_id: { type: 'string', description: 'External identifier for the contact' },
249+
created_at: { type: 'number', description: 'Unix timestamp when contact was created' },
250+
updated_at: { type: 'number', description: 'Unix timestamp when contact was last updated' },
251+
signed_up_at: { type: 'number', description: 'Unix timestamp when user signed up' },
252+
last_seen_at: { type: 'number', description: 'Unix timestamp when user was last seen' },
253+
workspace_id: { type: 'string', description: 'Workspace ID the contact belongs to' },
254+
custom_attributes: { type: 'object', description: 'Custom attributes set on the contact' },
255+
tags: {
256+
type: 'object',
257+
description: 'Tags associated with the contact',
258+
properties: {
259+
type: { type: 'string', description: 'List type' },
260+
url: { type: 'string', description: 'URL to fetch tags' },
261+
data: { type: 'array', description: 'Array of tag objects' },
262+
has_more: { type: 'boolean', description: 'Whether there are more tags' },
263+
total_count: { type: 'number', description: 'Total number of tags' },
264+
},
265+
},
266+
notes: {
267+
type: 'object',
268+
description: 'Notes associated with the contact',
269+
properties: {
270+
type: { type: 'string', description: 'List type' },
271+
url: { type: 'string', description: 'URL to fetch notes' },
272+
data: { type: 'array', description: 'Array of note objects' },
273+
has_more: { type: 'boolean', description: 'Whether there are more notes' },
274+
total_count: { type: 'number', description: 'Total number of notes' },
275+
},
276+
},
277+
companies: {
278+
type: 'object',
279+
description: 'Companies associated with the contact',
280+
properties: {
281+
type: { type: 'string', description: 'List type' },
282+
url: { type: 'string', description: 'URL to fetch companies' },
283+
data: { type: 'array', description: 'Array of company objects' },
284+
has_more: { type: 'boolean', description: 'Whether there are more companies' },
285+
total_count: { type: 'number', description: 'Total number of companies' },
286+
},
287+
},
288+
location: {
289+
type: 'object',
290+
description: 'Location information for the contact',
291+
properties: {
292+
type: { type: 'string', description: 'Location type' },
293+
city: { type: 'string', description: 'City' },
294+
region: { type: 'string', description: 'Region/State' },
295+
country: { type: 'string', description: 'Country' },
296+
country_code: { type: 'string', description: 'Country code' },
297+
continent_code: { type: 'string', description: 'Continent code' },
298+
},
299+
},
300+
social_profiles: {
301+
type: 'object',
302+
description: 'Social profiles of the contact',
303+
properties: {
304+
type: { type: 'string', description: 'List type' },
305+
data: { type: 'array', description: 'Array of social profile objects' },
306+
},
307+
},
308+
unsubscribed_from_emails: {
309+
type: 'boolean',
310+
description: 'Whether contact is unsubscribed from emails',
311+
},
193312
},
194313
},
314+
metadata: {
315+
type: 'object',
316+
description: 'Operation metadata',
317+
properties: {
318+
operation: { type: 'string', description: 'The operation performed (create_contact)' },
319+
contactId: { type: 'string', description: 'ID of the created contact' },
320+
},
321+
},
322+
success: { type: 'boolean', description: 'Operation success status' },
195323
},
196324
}

apps/sim/tools/intercom/create_message.ts

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,15 +161,27 @@ export const intercomCreateMessageTool: ToolConfig<
161161
},
162162

163163
outputs: {
164-
success: { type: 'boolean', description: 'Operation success status' },
165-
output: {
164+
message: {
166165
type: 'object',
167-
description: 'Created message data',
166+
description: 'Created message object',
168167
properties: {
169-
message: { type: 'object', description: 'Created message object' },
170-
metadata: { type: 'object', description: 'Operation metadata' },
171-
success: { type: 'boolean', description: 'Operation success' },
168+
id: { type: 'string', description: 'Unique identifier for the message' },
169+
type: { type: 'string', description: 'Object type (message)' },
170+
created_at: { type: 'number', description: 'Unix timestamp when message was created' },
171+
body: { type: 'string', description: 'Body of the message' },
172+
message_type: { type: 'string', description: 'Type of the message (in_app or email)' },
173+
conversation_id: { type: 'string', description: 'ID of the conversation created' },
174+
owner: { type: 'object', description: 'Owner of the message' },
172175
},
173176
},
177+
metadata: {
178+
type: 'object',
179+
description: 'Operation metadata',
180+
properties: {
181+
operation: { type: 'string', description: 'The operation performed (create_message)' },
182+
messageId: { type: 'string', description: 'ID of the created message' },
183+
},
184+
},
185+
success: { type: 'boolean', description: 'Operation success status' },
174186
},
175187
}

apps/sim/tools/intercom/create_ticket.ts

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,41 @@ export const intercomCreateTicketTool: ToolConfig<
149149
},
150150

151151
outputs: {
152-
success: { type: 'boolean', description: 'Operation success status' },
153-
output: {
152+
ticket: {
154153
type: 'object',
155-
description: 'Created ticket data',
154+
description: 'Created ticket object',
156155
properties: {
157-
ticket: { type: 'object', description: 'Created ticket object' },
158-
metadata: { type: 'object', description: 'Operation metadata' },
159-
success: { type: 'boolean', description: 'Operation success' },
156+
id: { type: 'string', description: 'Unique identifier for the ticket' },
157+
type: { type: 'string', description: 'Object type (ticket)' },
158+
ticket_id: { type: 'string', description: 'Ticket ID' },
159+
ticket_type: { type: 'object', description: 'Type of the ticket' },
160+
ticket_attributes: { type: 'object', description: 'Attributes of the ticket' },
161+
ticket_state: { type: 'string', description: 'State of the ticket' },
162+
ticket_state_internal_label: {
163+
type: 'string',
164+
description: 'Internal label for ticket state',
165+
},
166+
ticket_state_external_label: {
167+
type: 'string',
168+
description: 'External label for ticket state',
169+
},
170+
created_at: { type: 'number', description: 'Unix timestamp when ticket was created' },
171+
updated_at: { type: 'number', description: 'Unix timestamp when ticket was last updated' },
172+
contacts: { type: 'object', description: 'Contacts associated with the ticket' },
173+
admin_assignee_id: { type: 'string', description: 'ID of assigned admin' },
174+
team_assignee_id: { type: 'string', description: 'ID of assigned team' },
175+
is_shared: { type: 'boolean', description: 'Whether the ticket is shared' },
176+
open: { type: 'boolean', description: 'Whether the ticket is open' },
160177
},
161178
},
179+
metadata: {
180+
type: 'object',
181+
description: 'Operation metadata',
182+
properties: {
183+
operation: { type: 'string', description: 'The operation performed (create_ticket)' },
184+
ticketId: { type: 'string', description: 'ID of the created ticket' },
185+
},
186+
},
187+
success: { type: 'boolean', description: 'Operation success status' },
162188
},
163189
}

apps/sim/tools/intercom/delete_contact.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,15 @@ export const intercomDeleteContactTool: ToolConfig<
7777
},
7878

7979
outputs: {
80-
success: { type: 'boolean', description: 'Operation success status' },
81-
output: {
80+
id: { type: 'string', description: 'ID of deleted contact' },
81+
deleted: { type: 'boolean', description: 'Whether the contact was deleted' },
82+
metadata: {
8283
type: 'object',
83-
description: 'Deletion result',
84+
description: 'Operation metadata',
8485
properties: {
85-
id: { type: 'string', description: 'ID of deleted contact' },
86-
deleted: { type: 'boolean', description: 'Deletion status' },
87-
metadata: { type: 'object', description: 'Operation metadata' },
88-
success: { type: 'boolean', description: 'Operation success' },
86+
operation: { type: 'string', description: 'The operation performed (delete_contact)' },
8987
},
9088
},
89+
success: { type: 'boolean', description: 'Operation success status' },
9190
},
9291
}

0 commit comments

Comments
 (0)