lookup_user_by_email
Find Slack users by email address to identify team members, retrieve user details, or verify account information within your workspace.
Instructions
Lookup a user by their email address
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| Yes | The email address of the user |
Implementation Reference
- index.ts:239-251 (handler)Core handler function in SlackClient class that fetches user information from Slack API using the provided email address.async lookupUserByEmail(email: string): Promise<any> { const params = new URLSearchParams({ email: email, }); const response = await fetch(`https://slack.com/api/users.lookupByEmail?${params}`, { method: "GET", headers: this.botHeaders, }); return response.json(); }
- index.ts:213-226 (schema)Tool schema definition specifying name, description, and input schema requiring an 'email' parameter.const lookupUserByEmailTool: Tool = { name: "lookup_user_by_email", description: "Lookup a user by their email address", inputSchema: { type: "object", properties: { email: { type: "string", description: "The email address of the user", }, }, required: ["email"], }, };
- index.ts:570-580 (registration)Registration of the tool in the list of available tools returned by ListToolsRequest handler.tools: [ listChannelsTool, postMessageTool, replyToThreadTool, addReactionTool, getChannelHistoryTool, getThreadRepliesTool, getUsersTool, getUserProfileTool, lookupUserByEmailTool, ],
- index.ts:539-545 (handler)Dispatch handler in CallToolRequest that extracts email argument and calls the SlackClient lookupUserByEmail method.case "lookup_user_by_email": { const args = request.params.arguments as { email: string }; const response = await slackClient.lookupUserByEmail(args.email); return { content: [{ type: "text", text: JSON.stringify(response) }], }; }