lookup_user_by_email
Find Slack users by email address to identify team members, retrieve user profiles, or verify user existence within a 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 implementation of the lookup_user_by_email tool in SlackClient, performs API call to users.lookupByEmail.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:539-545 (handler)Dispatch handler in CallToolRequest that executes lookup_user_by_email by calling SlackClient 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) }], }; }
- index.ts:213-226 (registration)Registers the lookup_user_by_email tool with name, description, and input schema.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:213-226 (schema)Defines the input schema for the lookup_user_by_email tool.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-582 (registration)Registers lookupUserByEmailTool in the list of available tools returned by ListToolsRequest.tools: [ listChannelsTool, postMessageTool, replyToThreadTool, addReactionTool, getChannelHistoryTool, getThreadRepliesTool, getUsersTool, getUserProfileTool, lookupUserByEmailTool, ], }; });