Skip to main content
Glama

archive_channel

Archive Slack channels to organize your workspace by removing inactive channels from the active list.

Instructions

Archive a channel

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelYesChannel ID to archive

Implementation Reference

  • The main handler function that executes the archiving of a Slack channel using the conversations.archive API after parsing and validating the input arguments with archiveChannelSchema.
    export async function archiveChannel(client: SlackClientWrapper, args: unknown) { const params = archiveChannelSchema.parse(args); return await client.safeCall(async () => { await client.getClient().conversations.archive({ channel: params.channel, }); return { ok: true, channel: params.channel, }; }); }
  • Zod schema defining the input validation for the archive_channel tool, requiring a valid channel ID.
    export const archiveChannelSchema = z.object({ channel: channelIdSchema, });
  • src/index.ts:418-418 (registration)
    Registers the handler for the 'archive_channel' tool in the toolHandlers map, delegating to the archiveChannel function from channelTools with the Slack client.
    archive_channel: (args) => channelTools.archiveChannel(slackClient, args),
  • src/index.ts:106-119 (registration)
    Registers the 'archive_channel' tool in the tools list for the list_tools MCP request, providing name, description, and input schema for discovery.
    { name: 'archive_channel', description: 'Archive a channel', inputSchema: { type: 'object', properties: { channel: { type: 'string', description: 'Channel ID to archive', }, }, required: ['channel'], }, },

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