Skip to main content
Glama
z9905080
by z9905080

slack_list_channels

Retrieve a paginated list of public channels from a Slack workspace to help AI assistants browse and interact with available communication spaces.

Instructions

List public channels in the workspace with pagination

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cursorNoPagination cursor for next page of results
limitNoMaximum number of channels to return (default 100, max 200)

Implementation Reference

  • Handler logic for executing the slack_list_channels tool: parses arguments and delegates to SlackClient.getChannels method.
    case "slack_list_channels": { const args = request.params .arguments as unknown as ListChannelsArgs; const response = await slackClient.getChannels( args.limit, args.cursor, ); return { content: [{ type: "text", text: JSON.stringify(response) }], }; }
  • Tool schema definition for slack_list_channels, including name, description, and input schema.
    const listChannelsTool: Tool = { name: "slack_list_channels", description: "List public channels in the workspace with pagination", inputSchema: { type: "object", properties: { limit: { type: "number", description: "Maximum number of channels to return (default 100, max 200)", default: 100, }, cursor: { type: "string", description: "Pagination cursor for next page of results", }, }, }, };
  • index.ts:570-580 (registration)
    Registration of slack_list_channels tool by including it in the list returned by ListToolsRequest handler.
    tools: [ listChannelsTool, postMessageTool, replyToThreadTool, addReactionTool, getChannelHistoryTool, getThreadRepliesTool, getUsersTool, getUserProfileTool, lookupUserByEmailTool, ],
  • SlackClient.getChannels method: core implementation fetching public channels via Slack conversations.list API with pagination.
    async getChannels(limit: number = 100, cursor?: string): Promise<any> { const params = new URLSearchParams({ types: "public_channel", exclude_archived: "true", limit: Math.min(limit, 200).toString(), team_id: process.env.SLACK_TEAM_ID!, }); if (cursor) { params.append("cursor", cursor); } const response = await fetch( `https://slack.com/api/conversations.list?${params}`, { headers: this.botHeaders }, ); return response.json(); }

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

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