Skip to main content
Glama

invite_to_channel

Add users to a Slack channel by providing their user IDs and the target channel ID.

Instructions

Invite users to a channel

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelYesChannel ID
usersYesArray of user IDs to invite

Implementation Reference

  • The main handler function for the 'invite_to_channel' tool. It validates input using inviteToChannelSchema, calls Slack's conversations.invite API with channel and comma-separated users, and returns the channel info.
    export async function inviteToChannel(client: SlackClientWrapper, args: unknown) {
      const params = inviteToChannelSchema.parse(args);
    
      return await client.safeCall(async () => {
        const result = await client.getClient().conversations.invite({
          channel: params.channel,
          users: params.users.join(','),
        });
    
        return {
          ok: true,
          channel: result.channel,
        };
      });
    }
  • Zod schema defining input validation for invite_to_channel: requires channel ID and non-empty array of user IDs.
    export const inviteToChannelSchema = z.object({
      channel: channelIdSchema,
      users: z.array(userIdSchema).min(1),
    });
  • src/index.ts:151-171 (registration)
    Tool registration in the tools list for list_tools handler, including name, description, and MCP inputSchema.
    {
      name: 'invite_to_channel',
      description: 'Invite users to a channel',
      inputSchema: {
        type: 'object',
        properties: {
          channel: {
            type: 'string',
            description: 'Channel ID',
          },
          users: {
            type: 'array',
            items: {
              type: 'string',
            },
            description: 'Array of user IDs to invite',
          },
        },
        required: ['channel', 'users'],
      },
    },
  • src/index.ts:423-423 (registration)
    Maps 'invite_to_channel' tool name to the userTools.inviteToChannel handler in the call_tool dispatcher.
    invite_to_channel: (args) => userTools.inviteToChannel(slackClient, args),
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'invite' implies a mutation operation, it doesn't specify whether this requires specific permissions, what happens if users are already members, or if there are rate limits. The description lacks critical behavioral details for a tool that modifies channel membership.

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?

The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core action and target, making it easy to parse quickly. This is an excellent example of conciseness without sacrificing clarity for the basic purpose.

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

Completeness2/5

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

For a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't address behavioral aspects like permissions, error conditions, or what the tool returns (e.g., success status or invitation details). Given the complexity of user invitations, more context is needed to guide the agent effectively.

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?

The input schema has 100% description coverage, with clear documentation for 'channel' (Channel ID) and 'users' (Array of user IDs to invite). The description doesn't add any semantic details beyond this, such as format examples or constraints (e.g., maximum users per invite). Given the high schema coverage, a baseline score of 3 is appropriate.

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

Purpose4/5

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

The description 'Invite users to a channel' clearly states the action (invite) and target (users to a channel), making the purpose immediately understandable. However, it doesn't differentiate this tool from potential alternatives like 'add_user_to_channel' or 'create_channel_membership' that might exist in other contexts, though no direct siblings with similar functions are listed.

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. It doesn't mention prerequisites (e.g., needing channel admin permissions), exclusions (e.g., not for private channels), or related tools like 'create_channel' for initial setup. This leaves the agent to infer usage from context alone.

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

Install Server

Other Tools

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/Hais/slack-bot-mcp'

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