discord_create_channel
Create text, voice, or category channels in Discord servers to organize communication spaces for different topics or purposes.
Instructions
Create a text, voice channel or category in a guild.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| guild_id | Yes | ||
| name | Yes | ||
| type | No | Defaults to 'text'. | |
| topic | No | ||
| category_id | No |
Implementation Reference
- src/tools/channels.ts:80-92 (handler)The handler logic for 'discord_create_channel' which fetches the guild, determines the channel type, and creates the channel via the discord.js client.
case "discord_create_channel": { const guild = await discord.guilds.fetch(validateId(args.guild_id, "guild_id")); const typeMap: Record<string, ChannelType> = { text: ChannelType.GuildText, voice: ChannelType.GuildVoice, category: ChannelType.GuildCategory, }; const channelType = typeMap[(args.type as string) ?? "text"] ?? ChannelType.GuildText; const created = await guild.channels.create({ name: args.name as string, type: channelType as ChannelType.GuildText | ChannelType.GuildVoice | ChannelType.GuildCategory, topic: channelType === ChannelType.GuildText ? (args.topic as string | undefined) : undefined, parent: args.category_id as string | undefined, }); return { content: [{ type: "text", text: `✅ Channel #${created.name} created (id: ${created.id}).` }] }; } - src/tools/channels.ts:7-21 (schema)The schema definition for 'discord_create_channel' outlining the required and optional arguments.
{ name: "discord_create_channel", description: "Create a text, voice channel or category in a guild.", inputSchema: { type: "object", properties: { guild_id: { type: "string" }, name: { type: "string" }, type: { type: "string", enum: ["text", "voice", "category"], description: "Defaults to 'text'." }, topic: { type: "string" }, category_id: { type: "string" }, }, required: ["guild_id", "name"], }, },