Skip to main content
Glama
channels.ts1.77 kB
import { SlackClientWrapper } from '../utils/slack-client.js'; import { listChannelsSchema, getChannelInfoSchema, createChannelSchema, archiveChannelSchema, } from '../utils/validators.js'; 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, }; }); } export async function getChannelInfo(client: SlackClientWrapper, args: unknown) { const params = getChannelInfoSchema.parse(args); return await client.safeCall(async () => { const result = await client.getClient().conversations.info({ channel: params.channel, }); return { channel: result.channel, }; }); } export async function createChannel(client: SlackClientWrapper, args: unknown) { const params = createChannelSchema.parse(args); return await client.safeCall(async () => { const result = await client.getClient().conversations.create({ name: params.name, is_private: params.is_private, }); return { channel: result.channel, }; }); } 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, }; }); }

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