Skip to main content
Glama

list_channels

Retrieve available channels in a Slack workspace, with options to filter by channel type, exclude archived channels, and limit results.

Instructions

List channels in the Slack workspace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typesNoComma-separated list of channel types (public_channel, private_channel, mpim, im)public_channel,private_channel
exclude_archivedNoExclude archived channels
limitNoMaximum number of channels to return

Implementation Reference

  • The main handler function that implements the 'list_channels' tool logic. It validates input with Zod schema and calls Slack's conversations.list API, returning channels and pagination cursor.
    export async function listChannels(client: SlackClientWrapper, args: unknown) {
      const params = listChannelsSchema.parse(args);
    
      return await client.safeCall(async () => {
        const result = await client.getClient().conversations.list({
          types: params.types,
          exclude_archived: params.exclude_archived,
          limit: params.limit,
          cursor: params.cursor,
        });
    
        return {
          channels: result.channels || [],
          next_cursor: result.response_metadata?.next_cursor,
        };
      });
    }
  • Zod schema used for input validation in the listChannels handler.
    export const listChannelsSchema = z.object({
      types: z.string().optional().default('public_channel,private_channel'),
      exclude_archived: z.boolean().optional().default(true),
      limit: z.number().min(1).max(1000).optional().default(100),
      cursor: z.string().optional(),
    });
  • src/index.ts:47-72 (registration)
    Tool definition registration in the list_tools response, including name, description, and input schema.
    {
      name: 'list_channels',
      description: 'List channels in the Slack workspace',
      inputSchema: {
        type: 'object',
        properties: {
          types: {
            type: 'string',
            description: 'Comma-separated list of channel types (public_channel, private_channel, mpim, im)',
            default: 'public_channel,private_channel',
          },
          exclude_archived: {
            type: 'boolean',
            description: 'Exclude archived channels',
            default: true,
          },
          limit: {
            type: 'number',
            description: 'Maximum number of channels to return',
            default: 100,
            minimum: 1,
            maximum: 1000,
          },
        },
      },
    },
  • src/index.ts:415-415 (registration)
    Handler registration in the toolHandlers map for the call_tool request, linking 'list_channels' to the imported listChannels function.
    list_channels: (args) => channelTools.listChannels(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. It states the action ('List channels') but doesn't mention critical behaviors like whether this requires authentication, if there are rate limits, what the output format looks like, or if it's a paginated list. For a read operation with zero annotation coverage, this leaves significant gaps.

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 that directly states the tool's purpose without any unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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?

Given the lack of annotations and output schema, the description is incomplete. It doesn't address behavioral aspects like authentication needs, rate limits, or output format, which are crucial for a tool that lists data. While the schema covers parameters well, the overall context for safe and effective use is insufficient.

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 all three parameters (types, exclude_archived, limit). The description adds no additional parameter information beyond what's in the schema, so it meets the baseline score of 3 where the schema does the heavy lifting.

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 clearly states the verb ('List') and resource ('channels in the Slack workspace'), making the purpose immediately understandable. However, it doesn't distinguish this tool from potential sibling tools like 'get_channel_info' or 'search_messages' that might also retrieve channel information, so it doesn't reach the highest score.

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. With siblings like 'get_channel_info' (for specific channel details) and 'search_messages' (which might involve channels), there's no indication of when 'list_channels' is the appropriate choice or any prerequisites for its use.

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