Skip to main content
Glama
scarecr0w12

discord-mcp

create_channel

Add a new text, voice, category, announcement, forum, or stage channel to a Discord server by specifying its name, type, and server ID.

Instructions

Create a new channel in a Discord server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
guildIdYesThe ID of the server (guild)
nameYesName of the new channel
typeYesType of channel
parentIdNoID of the parent category
topicNoChannel topic (text channels only)
nsfwNoWhether the channel is NSFW
bitrateNoBitrate for voice channels
userLimitNoUser limit for voice channels
rateLimitPerUserNoSlowmode in seconds
positionNoPosition of the channel
reasonNoReason for creating the channel

Implementation Reference

  • The handler function for the create_channel tool. It fetches the Discord guild, constructs channel creation options based on input parameters (mapping type string to ChannelType enum), removes undefined options, creates the channel using guild.channels.create(), handles errors with withErrorHandling, and returns JSON-formatted response with new channel details.
    async ({ guildId, name, type, parentId, topic, nsfw, bitrate, userLimit, rateLimitPerUser, position, reason }) => {
      const result = await withErrorHandling(async () => {
        const client = await getDiscordClient();
        const guild = await client.guilds.fetch(guildId);
    
        const channelOptions: Record<string, unknown> = {
          name,
          type: channelTypeMap[type],
          parent: parentId,
          topic,
          nsfw,
          bitrate,
          userLimit,
          rateLimitPerUser,
          position,
          reason,
        };
    
        // Remove undefined values
        Object.keys(channelOptions).forEach((key) => {
          if (channelOptions[key] === undefined) delete channelOptions[key];
        });
    
        const newChannel = await guild.channels.create(channelOptions as any);
        return { id: newChannel.id, name: newChannel.name, type: ChannelType[newChannel.type], message: 'Channel created' };
      });
    
      if (!result.success) {
        return { content: [{ type: 'text', text: result.error }], isError: true };
      }
    
      return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] };
    }
  • Zod input schema for create_channel tool, validating parameters like guildId, name, type (enum of channel types), and optional fields for customization.
    {
      guildId: z.string().describe('The ID of the server (guild)'),
      name: z.string().describe('Name of the new channel'),
      type: z.enum(['text', 'voice', 'category', 'announcement', 'forum', 'stage']).describe('Type of channel'),
      parentId: z.string().optional().describe('ID of the parent category'),
      topic: z.string().optional().describe('Channel topic (text channels only)'),
      nsfw: z.boolean().optional().describe('Whether the channel is NSFW'),
      bitrate: z.number().optional().describe('Bitrate for voice channels'),
      userLimit: z.number().optional().describe('User limit for voice channels'),
      rateLimitPerUser: z.number().optional().describe('Slowmode in seconds'),
      position: z.number().optional().describe('Position of the channel'),
      reason: z.string().optional().describe('Reason for creating the channel'),
    },
  • Full registration of the create_channel tool using server.tool(), including name, description, input schema, and inline handler function.
    server.tool(
      'create_channel',
      'Create a new channel in a Discord server',
      {
        guildId: z.string().describe('The ID of the server (guild)'),
        name: z.string().describe('Name of the new channel'),
        type: z.enum(['text', 'voice', 'category', 'announcement', 'forum', 'stage']).describe('Type of channel'),
        parentId: z.string().optional().describe('ID of the parent category'),
        topic: z.string().optional().describe('Channel topic (text channels only)'),
        nsfw: z.boolean().optional().describe('Whether the channel is NSFW'),
        bitrate: z.number().optional().describe('Bitrate for voice channels'),
        userLimit: z.number().optional().describe('User limit for voice channels'),
        rateLimitPerUser: z.number().optional().describe('Slowmode in seconds'),
        position: z.number().optional().describe('Position of the channel'),
        reason: z.string().optional().describe('Reason for creating the channel'),
      },
      async ({ guildId, name, type, parentId, topic, nsfw, bitrate, userLimit, rateLimitPerUser, position, reason }) => {
        const result = await withErrorHandling(async () => {
          const client = await getDiscordClient();
          const guild = await client.guilds.fetch(guildId);
    
          const channelOptions: Record<string, unknown> = {
            name,
            type: channelTypeMap[type],
            parent: parentId,
            topic,
            nsfw,
            bitrate,
            userLimit,
            rateLimitPerUser,
            position,
            reason,
          };
    
          // Remove undefined values
          Object.keys(channelOptions).forEach((key) => {
            if (channelOptions[key] === undefined) delete channelOptions[key];
          });
    
          const newChannel = await guild.channels.create(channelOptions as any);
          return { id: newChannel.id, name: newChannel.name, type: ChannelType[newChannel.type], message: 'Channel created' };
        });
    
        if (!result.success) {
          return { content: [{ type: 'text', text: result.error }], isError: true };
        }
    
        return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] };
      }
  • src/index.ts:55-55 (registration)
    Top-level registration call to registerChannelTools(server), which includes the create_channel tool registration.
    registerChannelTools(server);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'Create' implies a write operation, it doesn't mention permission requirements, whether the operation is idempotent, rate limits, error conditions, or what happens on success (e.g., returns channel ID). For a mutation tool with 11 parameters, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states the core purpose without unnecessary words. It's appropriately sized for a tool with a clear primary function, though the lack of additional context means it might be too brief rather than optimally concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex mutation tool with 11 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what the tool returns, error conditions, permission requirements, or how it interacts with Discord's channel hierarchy. The 100% schema coverage helps with parameters, but other critical context is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with all parameters well-documented in the schema itself. The description adds no parameter-specific information beyond what's already in the schema descriptions, so it meets the baseline of 3 for high schema coverage without adding extra value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Create') and resource ('new channel in a Discord server'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'modify_channel' or 'delete_channel' beyond the obvious verb difference, nor does it specify what type of channel creation this handles versus 'create_thread' or 'create_forum_post'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing appropriate permissions), when to choose this over 'modify_channel' for channel setup, or how it relates to similar creation tools like 'create_thread' or 'create_forum_post' in the sibling list.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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

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