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
| Name | Required | Description | Default |
|---|---|---|---|
| channel | Yes | Channel ID to archive |
Implementation Reference
- src/tools/channels.ts:56-69 (handler)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, }; }); }
- src/utils/validators.ts:27-29 (schema)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'], }, },