From e7b4da2689bc4f1e1631026e2e8f0eba891979cb Mon Sep 17 00:00:00 2001 From: Waleed Date: Thu, 12 Mar 2026 13:27:37 -0700 Subject: [PATCH] feat(slack): add email field to get user and list users tools (#3509) * feat(slack): add email field to get user and list users tools * fix(slack): use empty string fallback for email and make type non-optional * fix(slack): comment out users:read.email scope pending app review --- apps/docs/content/docs/en/tools/slack.mdx | 2 ++ apps/sim/lib/oauth/oauth.ts | 1 + apps/sim/lib/oauth/utils.ts | 1 + apps/sim/tools/slack/get_user.ts | 1 + apps/sim/tools/slack/list_users.ts | 1 + apps/sim/tools/slack/types.ts | 11 +++++++++++ 6 files changed, 17 insertions(+) diff --git a/apps/docs/content/docs/en/tools/slack.mdx b/apps/docs/content/docs/en/tools/slack.mdx index 7ecfe09fe0..f89be8ef04 100644 --- a/apps/docs/content/docs/en/tools/slack.mdx +++ b/apps/docs/content/docs/en/tools/slack.mdx @@ -590,6 +590,7 @@ List all users in a Slack workspace. Returns user profiles with names and avatar | ↳ `name` | string | Username \(handle\) | | ↳ `real_name` | string | Full real name | | ↳ `display_name` | string | Display name shown in Slack | +| ↳ `email` | string | Email address \(requires users:read.email scope\) | | ↳ `is_bot` | boolean | Whether the user is a bot | | ↳ `is_admin` | boolean | Whether the user is a workspace admin | | ↳ `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. | ↳ `title` | string | Job title | | ↳ `phone` | string | Phone number | | ↳ `skype` | string | Skype handle | +| ↳ `email` | string | Email address \(requires users:read.email scope\) | | ↳ `is_bot` | boolean | Whether the user is a bot | | ↳ `is_admin` | boolean | Whether the user is a workspace admin | | ↳ `is_owner` | boolean | Whether the user is the workspace owner | diff --git a/apps/sim/lib/oauth/oauth.ts b/apps/sim/lib/oauth/oauth.ts index 9bef53c77b..25b1aff0f9 100644 --- a/apps/sim/lib/oauth/oauth.ts +++ b/apps/sim/lib/oauth/oauth.ts @@ -624,6 +624,7 @@ export const OAUTH_PROVIDERS: Record = { 'im:history', 'im:read', 'users:read', + // TODO: Add 'users:read.email' once Slack app review is approved 'files:write', 'files:read', 'canvases:write', diff --git a/apps/sim/lib/oauth/utils.ts b/apps/sim/lib/oauth/utils.ts index 2c77093a57..b23084895e 100644 --- a/apps/sim/lib/oauth/utils.ts +++ b/apps/sim/lib/oauth/utils.ts @@ -270,6 +270,7 @@ export const SCOPE_DESCRIPTIONS: Record = { 'im:history': 'Read direct message history', 'im:read': 'View direct message channels', 'users:read': 'View workspace users', + 'users:read.email': 'View user email addresses', 'files:write': 'Upload files', 'files:read': 'Download and read files', 'canvases:write': 'Create canvas documents', diff --git a/apps/sim/tools/slack/get_user.ts b/apps/sim/tools/slack/get_user.ts index bc0d803e6b..e63915f844 100644 --- a/apps/sim/tools/slack/get_user.ts +++ b/apps/sim/tools/slack/get_user.ts @@ -85,6 +85,7 @@ export const slackGetUserTool: ToolConfig