Skip to content

Commit 33070c3

Browse files
committed
feat(slack): add email field to get user and list users tools
1 parent ff2a152 commit 33070c3

File tree

6 files changed

+17
-0
lines changed

6 files changed

+17
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,7 @@ List all users in a Slack workspace. Returns user profiles with names and avatar
590590
|`name` | string | Username \(handle\) |
591591
|`real_name` | string | Full real name |
592592
|`display_name` | string | Display name shown in Slack |
593+
|`email` | string | Email address \(requires users:read.email scope\) |
593594
|`is_bot` | boolean | Whether the user is a bot |
594595
|`is_admin` | boolean | Whether the user is a workspace admin |
595596
|`is_owner` | boolean | Whether the user is the workspace owner |
@@ -629,6 +630,7 @@ Get detailed information about a specific Slack user by their user ID.
629630
|`title` | string | Job title |
630631
|`phone` | string | Phone number |
631632
|`skype` | string | Skype handle |
633+
|`email` | string | Email address \(requires users:read.email scope\) |
632634
|`is_bot` | boolean | Whether the user is a bot |
633635
|`is_admin` | boolean | Whether the user is a workspace admin |
634636
|`is_owner` | boolean | Whether the user is the workspace owner |

apps/sim/lib/oauth/oauth.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,7 @@ export const OAUTH_PROVIDERS: Record<string, OAuthProviderConfig> = {
639639
'im:history',
640640
'im:read',
641641
'users:read',
642+
'users:read.email',
642643
'files:write',
643644
'files:read',
644645
'canvases:write',

apps/sim/lib/oauth/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ export const SCOPE_DESCRIPTIONS: Record<string, string> = {
269269
'im:history': 'Read direct message history',
270270
'im:read': 'View direct message channels',
271271
'users:read': 'View workspace users',
272+
'users:read.email': 'View user email addresses',
272273
'files:write': 'Upload files',
273274
'files:read': 'Download and read files',
274275
'canvases:write': 'Create canvas documents',

apps/sim/tools/slack/get_user.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ export const slackGetUserTool: ToolConfig<SlackGetUserParams, SlackGetUserRespon
8585
first_name: profile.first_name || '',
8686
last_name: profile.last_name || '',
8787
title: profile.title || '',
88+
email: profile.email ?? null,
8889
phone: profile.phone || '',
8990
skype: profile.skype || '',
9091
is_bot: user.is_bot || false,

apps/sim/tools/slack/list_users.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export const slackListUsersTool: ToolConfig<SlackListUsersParams, SlackListUsers
9393
name: user.name,
9494
real_name: user.real_name || user.profile?.real_name || '',
9595
display_name: user.profile?.display_name || '',
96+
email: user.profile?.email ?? null,
9697
is_bot: user.is_bot || false,
9798
is_admin: user.is_admin || false,
9899
is_owner: user.is_owner || false,

apps/sim/tools/slack/types.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,11 @@ export const USER_OUTPUT_PROPERTIES = {
376376
title: { type: 'string', description: 'Job title', optional: true },
377377
phone: { type: 'string', description: 'Phone number', optional: true },
378378
skype: { type: 'string', description: 'Skype handle', optional: true },
379+
email: {
380+
type: 'string',
381+
description: 'Email address (requires users:read.email scope)',
382+
optional: true,
383+
},
379384
is_bot: { type: 'boolean', description: 'Whether the user is a bot' },
380385
is_admin: { type: 'boolean', description: 'Whether the user is a workspace admin' },
381386
is_owner: { type: 'boolean', description: 'Whether the user is the workspace owner' },
@@ -438,6 +443,11 @@ export const USER_SUMMARY_OUTPUT_PROPERTIES = {
438443
name: { type: 'string', description: 'Username (handle)' },
439444
real_name: { type: 'string', description: 'Full real name' },
440445
display_name: { type: 'string', description: 'Display name shown in Slack' },
446+
email: {
447+
type: 'string',
448+
description: 'Email address (requires users:read.email scope)',
449+
optional: true,
450+
},
441451
is_bot: { type: 'boolean', description: 'Whether the user is a bot' },
442452
is_admin: { type: 'boolean', description: 'Whether the user is a workspace admin' },
443453
is_owner: { type: 'boolean', description: 'Whether the user is the workspace owner' },
@@ -953,6 +963,7 @@ export interface SlackUser {
953963
title?: string
954964
phone?: string
955965
skype?: string
966+
email?: string | null
956967
is_bot: boolean
957968
is_admin: boolean
958969
is_owner: boolean

0 commit comments

Comments
 (0)