Skip to main content
Glama
z9905080

MCP Server for Slack

by z9905080

slack_get_user_profile

Retrieve detailed profile information for a specific Slack user by providing their user ID.

Instructions

Get detailed profile information for a specific user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idYesThe ID of the user

Implementation Reference

  • Core handler function in SlackClient that performs the API call to retrieve detailed user profile information from 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();
    }
  • Tool dispatch handler in the CallToolRequest that validates arguments and calls the SlackClient.getUserProfile method.
    case "slack_get_user_profile": {
      const args = request.params
        .arguments as unknown as GetUserProfileArgs;
      if (!args.user_id) {
        throw new Error("Missing required argument: user_id");
      }
      const response = await slackClient.getUserProfile(args.user_id);
      return {
        content: [{ type: "text", text: JSON.stringify(response) }],
      };
    }
  • Tool schema definition including name, description, and input schema for validation.
    const getUserProfileTool: Tool = {
      name: "slack_get_user_profile",
      description: "Get detailed profile information for a specific user",
      inputSchema: {
        type: "object",
        properties: {
          user_id: {
            type: "string",
            description: "The ID of the user",
          },
        },
        required: ["user_id"],
      },
    };
  • index.ts:567-582 (registration)
    Registration of the tool in the ListToolsRequest handler, making it discoverable by clients.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      console.log("Received ListToolsRequest");
      return {
        tools: [
          listChannelsTool,
          postMessageTool,
          replyToThreadTool,
          addReactionTool,
          getChannelHistoryTool,
          getThreadRepliesTool,
          getUsersTool,
          getUserProfileTool,
          lookupUserByEmailTool,
        ],
      };
    });
  • TypeScript interface defining the expected arguments for the tool.
    interface GetUserProfileArgs {
      user_id: string;
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided. The description does not disclose if the operation is read-only, rate limits, or any side effects. For a read tool, this is minimal but insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One sentence, no fluff, front-loaded with verb and resource. Very concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given low complexity (1 param) and no output schema, the description is minimally adequate. However, it lacks detail on what 'detailed profile information' includes.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with a clear description for user_id. The description adds no extra meaning beyond the schema, meeting the baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and resource 'detailed profile information for a specific user'. It distinguishes from sibling tools like slack_get_users (list all users) and others.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like slack_get_users. No context about prerequisites or limitations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.