Skip to main content
Glama
zencoderai

Slack

by zencoderai

slack_get_user_profile

Retrieve detailed profile information for a specific Slack user by providing their user ID. This tool helps you access user data from Slack workspaces through API integration.

Instructions

Get detailed profile information for a specific user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idYesThe ID of the user

Implementation Reference

  • Core implementation of the slack_get_user_profile tool logic in SlackClient class, making API call to Slack's users.profile.get endpoint.
    async getUserProfile(user_id: string): Promise<any> {
      const params = new URLSearchParams({
        user: user_id,
        include_labels: "true",
      });
    
      const response = await fetch(
        `https://slack.com/api/users.profile.get?${params}`,
        { headers: this.botHeaders },
      );
    
      return response.json();
    }
  • index.ts:358-373 (registration)
    Registration of the slack_get_user_profile tool with MCP server, including input schema validation and wrapper handler.
    server.registerTool(
      "slack_get_user_profile",
      {
        title: "Get Slack User Profile",
        description: "Get detailed profile information for a specific user",
        inputSchema: {
          user_id: z.string().describe("The ID of the user"),
        },
      },
      async ({ user_id }) => {
        const response = await slackClient.getUserProfile(user_id);
        return {
          content: [{ type: "text", text: JSON.stringify(response) }],
        };
      }
    );
  • TypeScript interface defining the input arguments for the slack_get_user_profile tool.
    interface GetUserProfileArgs {
      user_id: string;
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zencoderai/slack-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server