Skip to content

Commit ad0d250

Browse files
committed
feat(slack): added get message tool
1 parent eb52f69 commit ad0d250

File tree

9 files changed

+311
-18
lines changed

9 files changed

+311
-18
lines changed

apps/docs/components/icons.tsx

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1855,17 +1855,25 @@ export function LinearIcon(props: React.SVGProps<SVGSVGElement>) {
18551855

18561856
export function LemlistIcon(props: SVGProps<SVGSVGElement>) {
18571857
return (
1858-
<svg
1859-
{...props}
1860-
xmlns='http://www.w3.org/2000/svg'
1861-
viewBox='0 0 24 24'
1862-
width='24'
1863-
height='24'
1864-
fill='none'
1865-
>
1866-
<rect width='24' height='24' rx='4' fill='#316BFF' />
1867-
<path d='M7 6h2v9h5v2H7V6Z' fill='white' />
1868-
<circle cx='17' cy='8' r='2' fill='white' />
1858+
<svg {...props} xmlns='http://www.w3.org/2000/svg' viewBox='0 0 180 181' fill='none'>
1859+
<path
1860+
fillRule='evenodd'
1861+
clipRule='evenodd'
1862+
d='M32.0524 0.919922H147.948C165.65 0.919922 180 15.2703 180 32.9723V148.867C180 166.57 165.65 180.92 147.948 180.92H32.0524C14.3504 180.92 0 166.57 0 148.867V32.9723C0 15.2703 14.3504 0.919922 32.0524 0.919922ZM119.562 82.8879H85.0826C82.4732 82.8879 80.3579 85.0032 80.3579 87.6126V94.2348C80.3579 96.8442 82.4732 98.9595 85.0826 98.9595H119.562C122.171 98.9595 124.286 96.8442 124.286 94.2348V87.6126C124.286 85.0032 122.171 82.8879 119.562 82.8879ZM85.0826 49.1346H127.061C129.67 49.1346 131.785 51.2499 131.785 53.8593V60.4815C131.785 63.0909 129.67 65.2062 127.061 65.2062H85.0826C82.4732 65.2062 80.3579 63.0909 80.3579 60.4815V53.8593C80.3579 51.2499 82.4732 49.1346 85.0826 49.1346ZM131.785 127.981V121.358C131.785 118.75 129.669 116.634 127.061 116.634H76.5706C69.7821 116.634 64.2863 111.138 64.2863 104.349V53.8593C64.2863 51.2513 62.1697 49.1346 59.5616 49.1346H52.9395C50.3314 49.1346 48.2147 51.2513 48.2147 53.8593V114.199C48.8497 124.133 56.7873 132.07 66.7205 132.705H127.061C129.669 132.705 131.785 130.589 131.785 127.981Z'
1863+
fill='#316BFF'
1864+
/>
1865+
<path
1866+
d='M85.0826 49.1346H127.061C129.67 49.1346 131.785 51.2499 131.785 53.8593V60.4815C131.785 63.0909 129.67 65.2062 127.061 65.2062H85.0826C82.4732 65.2062 80.3579 63.0909 80.3579 60.4815V53.8593C80.3579 51.2499 82.4732 49.1346 85.0826 49.1346Z'
1867+
fill='white'
1868+
/>
1869+
<path
1870+
d='M85.0826 82.8879H119.562C122.171 82.8879 124.286 85.0032 124.286 87.6126V94.2348C124.286 96.8442 122.171 98.9595 119.562 98.9595H85.0826C82.4732 98.9595 80.3579 96.8442 80.3579 94.2348V87.6126C80.3579 85.0032 82.4732 82.8879 85.0826 82.8879Z'
1871+
fill='white'
1872+
/>
1873+
<path
1874+
d='M131.785 121.358V127.981C131.785 130.589 129.669 132.705 127.061 132.705H66.7205C56.7873 132.07 48.8497 124.133 48.2147 114.199V53.8593C48.2147 51.2513 50.3314 49.1346 52.9395 49.1346H59.5616C62.1697 49.1346 64.2863 51.2513 64.2863 53.8593V104.349C64.2863 111.138 69.7821 116.634 76.5706 116.634H127.061C129.669 116.634 131.785 118.75 131.785 121.358Z'
1875+
fill='white'
1876+
/>
18691877
</svg>
18701878
)
18711879
}

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,3 @@ Delete the push notification webhook configuration for a task.
208208
| `success` | boolean | Whether deletion was successful |
209209

210210

211-
212-
## Notes
213-
214-
- Category: `tools`
215-
- Type: `a2a`

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ Retrieves lead information by email address or lead ID.
4949
| Parameter | Type | Required | Description |
5050
| --------- | ---- | -------- | ----------- |
5151
| `apiKey` | string | Yes | Lemlist API key |
52-
| `email` | string | No | Lead email address \(use either email or id\) |
53-
| `id` | string | No | Lead ID \(use either email or id\) |
52+
| `leadIdentifier` | string | Yes | Lead email address or lead ID |
5453

5554
#### Output
5655

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,25 @@ Read the latest messages from Slack channels. Retrieve conversation history with
124124
| --------- | ---- | ----------- |
125125
| `messages` | array | Array of message objects from the channel |
126126

127+
### `slack_get_message`
128+
129+
Retrieve a specific message by its timestamp. Useful for getting a thread parent message.
130+
131+
#### Input
132+
133+
| Parameter | Type | Required | Description |
134+
| --------- | ---- | -------- | ----------- |
135+
| `authMethod` | string | No | Authentication method: oauth or bot_token |
136+
| `botToken` | string | No | Bot token for Custom Bot |
137+
| `channel` | string | Yes | Slack channel ID \(e.g., C1234567890\) |
138+
| `timestamp` | string | Yes | Message timestamp to retrieve \(e.g., 1405894322.002768\) |
139+
140+
#### Output
141+
142+
| Parameter | Type | Description |
143+
| --------- | ---- | ----------- |
144+
| `message` | object | The retrieved message object |
145+
127146
### `slack_list_channels`
128147

129148
List all channels in a Slack workspace. Returns public and private channels the bot has access to.

apps/sim/blocks/blocks/slack.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export const SlackBlock: BlockConfig<SlackResponse> = {
2626
{ label: 'Send Message', id: 'send' },
2727
{ label: 'Create Canvas', id: 'canvas' },
2828
{ label: 'Read Messages', id: 'read' },
29+
{ label: 'Get Message', id: 'get_message' },
2930
{ label: 'List Channels', id: 'list_channels' },
3031
{ label: 'List Channel Members', id: 'list_members' },
3132
{ label: 'List Users', id: 'list_users' },
@@ -316,6 +317,32 @@ export const SlackBlock: BlockConfig<SlackResponse> = {
316317
},
317318
required: true,
318319
},
320+
// Get Message specific fields
321+
{
322+
id: 'getMessageTimestamp',
323+
title: 'Message Timestamp',
324+
type: 'short-input',
325+
placeholder: 'Message timestamp (e.g., 1405894322.002768)',
326+
condition: {
327+
field: 'operation',
328+
value: 'get_message',
329+
},
330+
required: true,
331+
wandConfig: {
332+
enabled: true,
333+
prompt: `Extract or generate a Slack message timestamp from the user's input.
334+
Slack message timestamps are in the format: XXXXXXXXXX.XXXXXX (seconds.microseconds since Unix epoch).
335+
Examples:
336+
- "1405894322.002768" -> 1405894322.002768 (already a valid timestamp)
337+
- "thread_ts from the trigger" -> The user wants to reference a variable, output the original text
338+
- A URL like "https://slack.com/archives/C123/p1405894322002768" -> Extract 1405894322.002768 (remove 'p' prefix, add decimal after 10th digit)
339+
340+
If the input looks like a reference to another block's output (contains < and >) or a variable, return it as-is.
341+
Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
342+
placeholder: 'Paste a Slack message URL or timestamp...',
343+
generationType: 'timestamp',
344+
},
345+
},
319346
{
320347
id: 'oldest',
321348
title: 'Oldest Timestamp',
@@ -430,6 +457,7 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
430457
'slack_message',
431458
'slack_canvas',
432459
'slack_message_reader',
460+
'slack_get_message',
433461
'slack_list_channels',
434462
'slack_list_members',
435463
'slack_list_users',
@@ -448,6 +476,8 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
448476
return 'slack_canvas'
449477
case 'read':
450478
return 'slack_message_reader'
479+
case 'get_message':
480+
return 'slack_get_message'
451481
case 'list_channels':
452482
return 'slack_list_channels'
453483
case 'list_members':
@@ -498,6 +528,7 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
498528
includeDeleted,
499529
userLimit,
500530
userId,
531+
getMessageTimestamp,
501532
...rest
502533
} = params
503534

@@ -574,6 +605,13 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
574605
break
575606
}
576607

608+
case 'get_message':
609+
if (!getMessageTimestamp) {
610+
throw new Error('Message timestamp is required for get message operation')
611+
}
612+
baseParams.timestamp = getMessageTimestamp
613+
break
614+
577615
case 'list_channels': {
578616
baseParams.includePrivate = includePrivate !== 'false'
579617
baseParams.excludeArchived = true
@@ -679,6 +717,8 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
679717
userLimit: { type: 'string', description: 'Maximum number of users to return' },
680718
// Get User inputs
681719
userId: { type: 'string', description: 'User ID to look up' },
720+
// Get Message inputs
721+
getMessageTimestamp: { type: 'string', description: 'Message timestamp to retrieve' },
682722
},
683723
outputs: {
684724
// slack_message outputs (send operation)

apps/sim/tools/registry.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,6 +1180,7 @@ import {
11801180
slackCanvasTool,
11811181
slackDeleteMessageTool,
11821182
slackDownloadTool,
1183+
slackGetMessageTool,
11831184
slackGetUserTool,
11841185
slackListChannelsTool,
11851186
slackListMembersTool,
@@ -1731,6 +1732,7 @@ export const tools: Record<string, ToolConfig> = {
17311732
slack_list_members: slackListMembersTool,
17321733
slack_list_users: slackListUsersTool,
17331734
slack_get_user: slackGetUserTool,
1735+
slack_get_message: slackGetMessageTool,
17341736
slack_canvas: slackCanvasTool,
17351737
slack_download: slackDownloadTool,
17361738
slack_update_message: slackUpdateMessageTool,

0 commit comments

Comments
 (0)