Skip to content

Commit 4c83959

Browse files
waleedlatif1claude
andauthored
feat(slack): add conversations.create and conversations.invite tools (#3720)
* feat(slack): add conversations.create and conversations.invite tools * fix(slack): address PR review comments on conversation tools * feat(slack): wire create/invite conversation tools into Slack block * lint * fix(slack): rename channel output to channelInfo to avoid type collision The block outputs already declare `channel` as type string (channel ID from send operation). Rename the object output to `channelInfo` to match the pattern used by get_channel_info and avoid [object Object] rendering. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs(slack): update output key in docs to match channelInfo rename Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(docs): fix lint errors in auto-generated docs files Sort imports in icon-mapping.ts and add trailing newline to meta.json. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * lint --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f02f85f commit 4c83959

File tree

8 files changed

+534
-1
lines changed

8 files changed

+534
-1
lines changed

apps/docs/content/docs/en/tools/slack.mdx

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -925,6 +925,82 @@ Create a canvas pinned to a Slack channel as its resource hub
925925
| --------- | ---- | ----------- |
926926
| `canvas_id` | string | ID of the created channel canvas |
927927

928+
### `slack_create_conversation`
929+
930+
Create a new public or private channel in a Slack workspace.
931+
932+
#### Input
933+
934+
| Parameter | Type | Required | Description |
935+
| --------- | ---- | -------- | ----------- |
936+
| `authMethod` | string | No | Authentication method: oauth or bot_token |
937+
| `botToken` | string | No | Bot token for Custom Bot |
938+
| `name` | string | Yes | Name of the channel to create \(lowercase, numbers, hyphens, underscores only; max 80 characters\) |
939+
| `isPrivate` | boolean | No | Create a private channel instead of a public one \(default: false\) |
940+
| `teamId` | string | No | Encoded team ID to create the channel in \(required if using an org token\) |
941+
942+
#### Output
943+
944+
| Parameter | Type | Description |
945+
| --------- | ---- | ----------- |
946+
| `channelInfo` | object | The newly created channel object |
947+
|`id` | string | Channel ID \(e.g., C1234567890\) |
948+
|`name` | string | Channel name without # prefix |
949+
|`is_channel` | boolean | Whether this is a channel |
950+
|`is_private` | boolean | Whether channel is private |
951+
|`is_archived` | boolean | Whether channel is archived |
952+
|`is_general` | boolean | Whether this is the general channel |
953+
|`is_member` | boolean | Whether the bot/user is a member |
954+
|`is_shared` | boolean | Whether channel is shared across workspaces |
955+
|`is_ext_shared` | boolean | Whether channel is externally shared |
956+
|`is_org_shared` | boolean | Whether channel is org-wide shared |
957+
|`num_members` | number | Number of members in the channel |
958+
|`topic` | string | Channel topic |
959+
|`purpose` | string | Channel purpose/description |
960+
|`created` | number | Unix timestamp when channel was created |
961+
|`creator` | string | User ID of channel creator |
962+
|`updated` | number | Unix timestamp of last update |
963+
964+
### `slack_invite_to_conversation`
965+
966+
Invite one or more users to a Slack channel. Supports up to 100 users at a time.
967+
968+
#### Input
969+
970+
| Parameter | Type | Required | Description |
971+
| --------- | ---- | -------- | ----------- |
972+
| `authMethod` | string | No | Authentication method: oauth or bot_token |
973+
| `botToken` | string | No | Bot token for Custom Bot |
974+
| `channel` | string | Yes | The ID of the channel to invite users to |
975+
| `users` | string | Yes | Comma-separated list of user IDs to invite \(up to 100\) |
976+
| `force` | boolean | No | When true, continues inviting valid users while skipping invalid ones \(default: false\) |
977+
978+
#### Output
979+
980+
| Parameter | Type | Description |
981+
| --------- | ---- | ----------- |
982+
| `channelInfo` | object | The channel object after inviting users |
983+
|`id` | string | Channel ID \(e.g., C1234567890\) |
984+
|`name` | string | Channel name without # prefix |
985+
|`is_channel` | boolean | Whether this is a channel |
986+
|`is_private` | boolean | Whether channel is private |
987+
|`is_archived` | boolean | Whether channel is archived |
988+
|`is_general` | boolean | Whether this is the general channel |
989+
|`is_member` | boolean | Whether the bot/user is a member |
990+
|`is_shared` | boolean | Whether channel is shared across workspaces |
991+
|`is_ext_shared` | boolean | Whether channel is externally shared |
992+
|`is_org_shared` | boolean | Whether channel is org-wide shared |
993+
|`num_members` | number | Number of members in the channel |
994+
|`topic` | string | Channel topic |
995+
|`purpose` | string | Channel purpose/description |
996+
|`created` | number | Unix timestamp when channel was created |
997+
|`creator` | string | User ID of channel creator |
998+
|`updated` | number | Unix timestamp of last update |
999+
| `errors` | array | Per-user errors when force is true and some invitations failed |
1000+
|`user` | string | User ID that failed |
1001+
|`ok` | boolean | Always false for error entries |
1002+
|`error` | string | Error code for this user |
1003+
9281004
### `slack_open_view`
9291005

9301006
Open a modal view in Slack using a trigger_id from an interaction payload. Used to display forms, confirmations, and other interactive modals.

apps/sim/app/(landing)/integrations/data/integrations.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9581,6 +9581,14 @@
95819581
"name": "Create Channel Canvas",
95829582
"description": "Create a canvas pinned to a Slack channel as its resource hub"
95839583
},
9584+
{
9585+
"name": "Create Conversation",
9586+
"description": "Create a new public or private channel in a Slack workspace."
9587+
},
9588+
{
9589+
"name": "Invite to Conversation",
9590+
"description": "Invite one or more users to a Slack channel. Supports up to 100 users at a time."
9591+
},
95849592
{
95859593
"name": "Open View",
95869594
"description": "Open a modal view in Slack using a trigger_id from an interaction payload. Used to display forms, confirmations, and other interactive modals."
@@ -9598,7 +9606,7 @@
95989606
"description": "Publish a static view to a user"
95999607
}
96009608
],
9601-
"operationCount": 23,
9609+
"operationCount": 25,
96029610
"triggers": [
96039611
{
96049612
"id": "slack_webhook",

apps/sim/blocks/blocks/slack.ts

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ export const SlackBlock: BlockConfig<SlackResponse> = {
4646
{ label: 'Get User Presence', id: 'get_user_presence' },
4747
{ label: 'Edit Canvas', id: 'edit_canvas' },
4848
{ label: 'Create Channel Canvas', id: 'create_channel_canvas' },
49+
{ label: 'Create Conversation', id: 'create_conversation' },
50+
{ label: 'Invite to Conversation', id: 'invite_to_conversation' },
4951
{ label: 'Open View', id: 'open_view' },
5052
{ label: 'Update View', id: 'update_view' },
5153
{ label: 'Push View', id: 'push_view' },
@@ -144,6 +146,7 @@ export const SlackBlock: BlockConfig<SlackResponse> = {
144146
'get_user',
145147
'get_user_presence',
146148
'edit_canvas',
149+
'create_conversation',
147150
'open_view',
148151
'update_view',
149152
'push_view',
@@ -179,6 +182,7 @@ export const SlackBlock: BlockConfig<SlackResponse> = {
179182
'get_user',
180183
'get_user_presence',
181184
'edit_canvas',
185+
'create_conversation',
182186
'open_view',
183187
'update_view',
184188
'push_view',
@@ -816,6 +820,70 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
816820
value: 'create_channel_canvas',
817821
},
818822
},
823+
// Create Conversation specific fields
824+
{
825+
id: 'conversationName',
826+
title: 'Channel Name',
827+
type: 'short-input',
828+
placeholder: 'e.g., project-updates',
829+
condition: {
830+
field: 'operation',
831+
value: 'create_conversation',
832+
},
833+
required: true,
834+
},
835+
{
836+
id: 'isPrivate',
837+
title: 'Private Channel',
838+
type: 'dropdown',
839+
options: [
840+
{ label: 'No', id: 'false' },
841+
{ label: 'Yes', id: 'true' },
842+
],
843+
value: () => 'false',
844+
condition: {
845+
field: 'operation',
846+
value: 'create_conversation',
847+
},
848+
},
849+
{
850+
id: 'teamId',
851+
title: 'Team ID',
852+
type: 'short-input',
853+
placeholder: 'Encoded team ID (org tokens only)',
854+
condition: {
855+
field: 'operation',
856+
value: 'create_conversation',
857+
},
858+
mode: 'advanced',
859+
},
860+
// Invite to Conversation specific fields
861+
{
862+
id: 'inviteUsers',
863+
title: 'User IDs',
864+
type: 'short-input',
865+
placeholder: 'Comma-separated user IDs (e.g., U123,U456)',
866+
condition: {
867+
field: 'operation',
868+
value: 'invite_to_conversation',
869+
},
870+
required: true,
871+
},
872+
{
873+
id: 'inviteForce',
874+
title: 'Skip Invalid Users',
875+
type: 'dropdown',
876+
options: [
877+
{ label: 'No', id: 'false' },
878+
{ label: 'Yes', id: 'true' },
879+
],
880+
value: () => 'false',
881+
condition: {
882+
field: 'operation',
883+
value: 'invite_to_conversation',
884+
},
885+
mode: 'advanced',
886+
},
819887
// Open View / Push View specific fields
820888
{
821889
id: 'viewTriggerId',
@@ -990,6 +1058,8 @@ Do not include any explanations, markdown formatting, or other text outside the
9901058
'slack_get_user_presence',
9911059
'slack_edit_canvas',
9921060
'slack_create_channel_canvas',
1061+
'slack_create_conversation',
1062+
'slack_invite_to_conversation',
9931063
'slack_open_view',
9941064
'slack_update_view',
9951065
'slack_push_view',
@@ -1036,6 +1106,10 @@ Do not include any explanations, markdown formatting, or other text outside the
10361106
return 'slack_edit_canvas'
10371107
case 'create_channel_canvas':
10381108
return 'slack_create_channel_canvas'
1109+
case 'create_conversation':
1110+
return 'slack_create_conversation'
1111+
case 'invite_to_conversation':
1112+
return 'slack_invite_to_conversation'
10391113
case 'open_view':
10401114
return 'slack_open_view'
10411115
case 'update_view':
@@ -1090,6 +1164,11 @@ Do not include any explanations, markdown formatting, or other text outside the
10901164
canvasTitle,
10911165
channelCanvasTitle,
10921166
channelCanvasContent,
1167+
conversationName,
1168+
isPrivate,
1169+
teamId,
1170+
inviteUsers,
1171+
inviteForce,
10931172
viewTriggerId,
10941173
viewInteractivityPointer,
10951174
viewId,
@@ -1264,6 +1343,21 @@ Do not include any explanations, markdown formatting, or other text outside the
12641343
}
12651344
break
12661345

1346+
case 'create_conversation':
1347+
baseParams.name = conversationName
1348+
baseParams.isPrivate = isPrivate === 'true'
1349+
if (teamId) {
1350+
baseParams.teamId = teamId
1351+
}
1352+
break
1353+
1354+
case 'invite_to_conversation':
1355+
baseParams.users = inviteUsers
1356+
if (inviteForce === 'true') {
1357+
baseParams.force = true
1358+
}
1359+
break
1360+
12671361
case 'open_view':
12681362
baseParams.triggerId = viewTriggerId
12691363
if (viewInteractivityPointer) {
@@ -1367,6 +1461,13 @@ Do not include any explanations, markdown formatting, or other text outside the
13671461
// Create Channel Canvas inputs
13681462
channelCanvasTitle: { type: 'string', description: 'Title for channel canvas' },
13691463
channelCanvasContent: { type: 'string', description: 'Content for channel canvas' },
1464+
// Create Conversation inputs
1465+
conversationName: { type: 'string', description: 'Name for the new channel' },
1466+
isPrivate: { type: 'string', description: 'Create as private channel (true/false)' },
1467+
teamId: { type: 'string', description: 'Encoded team ID for org tokens' },
1468+
// Invite to Conversation inputs
1469+
inviteUsers: { type: 'string', description: 'Comma-separated user IDs to invite' },
1470+
inviteForce: { type: 'string', description: 'Skip invalid users (true/false)' },
13701471
// View operation inputs
13711472
viewTriggerId: { type: 'string', description: 'Trigger ID from interaction payload' },
13721473
viewInteractivityPointer: {
@@ -1524,6 +1625,13 @@ Do not include any explanations, markdown formatting, or other text outside the
15241625
'View object with properties: id, team_id, type, title, submit, close, blocks, private_metadata, callback_id, external_id, state, hash, clear_on_close, notify_on_close, root_view_id, previous_view_id, app_id, bot_id',
15251626
},
15261627

1628+
// slack_invite_to_conversation outputs (invite_to_conversation operation)
1629+
errors: {
1630+
type: 'json',
1631+
description:
1632+
'Array of per-user error objects when force is true and some invitations failed (user, ok, error)',
1633+
},
1634+
15271635
// Trigger outputs (when used as webhook trigger)
15281636
event_type: { type: 'string', description: 'Type of Slack event that triggered the workflow' },
15291637
channel_name: { type: 'string', description: 'Human-readable channel name' },

apps/sim/tools/registry.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1948,6 +1948,7 @@ import {
19481948
slackAddReactionTool,
19491949
slackCanvasTool,
19501950
slackCreateChannelCanvasTool,
1951+
slackCreateConversationTool,
19511952
slackDeleteMessageTool,
19521953
slackDownloadTool,
19531954
slackEditCanvasTool,
@@ -1957,6 +1958,7 @@ import {
19571958
slackGetThreadTool,
19581959
slackGetUserPresenceTool,
19591960
slackGetUserTool,
1961+
slackInviteToConversationTool,
19601962
slackListChannelsTool,
19611963
slackListMembersTool,
19621964
slackListUsersTool,
@@ -2822,6 +2824,8 @@ export const tools: Record<string, ToolConfig> = {
28222824
slack_publish_view: slackPublishViewTool,
28232825
slack_edit_canvas: slackEditCanvasTool,
28242826
slack_create_channel_canvas: slackCreateChannelCanvasTool,
2827+
slack_create_conversation: slackCreateConversationTool,
2828+
slack_invite_to_conversation: slackInviteToConversationTool,
28252829
github_repo_info: githubRepoInfoTool,
28262830
github_repo_info_v2: githubRepoInfoV2Tool,
28272831
github_latest_commit: githubLatestCommitTool,

0 commit comments

Comments
 (0)