Skip to main content
Glama
jar285

MCP-Discord

by jar285

discord_create_text_channel

Create a new text channel in Discord with a specified name and optional topic. Simplify channel management for organized server communication and collaboration.

Instructions

Creates a new text channel in a Discord server with an optional topic

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelNameYes
guildIdYes
topicNo

Implementation Reference

  • The switch case handler that executes the discord_create_text_channel tool. Parses arguments using CreateTextChannelSchema, fetches the guild, creates a new text channel using Discord.js guild.channels.create(), and returns success or error response.
    case "discord_create_text_channel": { const { guildId, channelName, topic } = CreateTextChannelSchema.parse(args); try { if (!client.isReady()) { return { content: [{ type: "text", text: "Discord client not logged in. Please use discord_login tool first." }], isError: true }; } const guild = await client.guilds.fetch(guildId); if (!guild) { return { content: [{ type: "text", text: `Cannot find guild with ID: ${guildId}` }], isError: true }; } // Create the text channel const channel = await guild.channels.create({ name: channelName, type: ChannelType.GuildText, topic: topic }); return { content: [{ type: "text", text: `Successfully created text channel "${channelName}" with ID: ${channel.id}` }] }; } catch (error) { return { content: [{ type: "text", text: `Failed to create text channel: ${error}` }], isError: true }; } }
  • Zod schema defining input validation for the tool: guildId (required string), channelName (required string), topic (optional string). Used in handler for parsing args.
    const CreateTextChannelSchema = z.object({ guildId: z.string(), channelName: z.string(), topic: z.string().optional() });
  • src/index.ts:278-290 (registration)
    Tool registration in the MCP server's ListTools response, including name, description, and inputSchema matching the zod schema.
    { name: "discord_create_text_channel", description: "Creates a new text channel in a Discord server with an optional topic", inputSchema: { type: "object", properties: { guildId: { type: "string" }, channelName: { type: "string" }, topic: { type: "string" } }, required: ["guildId", "channelName"] } },

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/jar285/mcp-discord'

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