Skip to main content
Glama

discord_create_text_channel

Create a new text channel in a Discord server to organize conversations, with an optional topic for context.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
guildIdYes
channelNameYes
topicNo

Implementation Reference

  • The main handler function that executes the discord_create_text_channel tool. It validates input with CreateTextChannelSchema, fetches the guild, creates a text channel using guild.channels.create(), and returns success or error response.
    export async function createTextChannelHandler(
      args: unknown,
      context: ToolContext
    ): Promise<ToolResponse> {
      const { guildId, channelName, topic, reason } =
        CreateTextChannelSchema.parse(args);
      try {
        if (!context.client.isReady()) {
          return {
            content: [{ type: 'text', text: 'Discord client not logged in.' }],
            isError: true,
          };
        }
    
        const guild = await context.client.guilds.fetch(guildId);
        if (!guild) {
          return {
            content: [
              { type: 'text', text: `Cannot find guild with ID: ${guildId}` },
            ],
            isError: true,
          };
        }
    
        // Create the text channel
        const channelOptions: {
          name: string;
          type: ChannelType.GuildText;
          topic?: string;
          reason?: string;
        } = {
          name: channelName,
          type: ChannelType.GuildText,
        };
        if (topic !== undefined) {
          channelOptions.topic = topic;
        }
        if (reason !== undefined) {
          channelOptions.reason = reason;
        }
        const channel = await guild.channels.create(channelOptions);
    
        return {
          content: [
            {
              type: 'text',
              text: `Successfully created text channel "${channelName}" with ID: ${channel.id}`,
            },
          ],
        };
      } catch (error) {
        return handleDiscordError(error);
      }
    }
  • MCP tool schema definition for discord_create_text_channel, including name, description, and inputSchema used for tool listing and validation.
    {
      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'],
      },
    },
  • src/server.ts:138-144 (registration)
    Registration and dispatch in the main server switch statement, calling createTextChannelHandler for the tool execution.
    case 'discord_create_text_channel':
      this.logClientState('before discord_create_text_channel handler');
      toolResponse = await createTextChannelHandler(
        args,
        this.toolContext
      );
      return toolResponse;
  • Additional registration in the HTTP transport handler switch for direct method calls.
    case 'discord_create_text_channel':
      result = await createTextChannelHandler(
        params,
        this.toolContext!
      );
      break;
  • Re-export of createTextChannelHandler from channel.ts, used by server.ts and transport.ts imports.
    export {
      createCategoryHandler,
      createTextChannelHandler,
      deleteCategoryHandler,
      deleteChannelHandler,
      editCategoryHandler,
      getServerInfoHandler,
      readMessagesHandler,
    } from './channel.js';
    export {
      createForumPostHandler,
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. It states the action is a creation but lacks details on permissions required (e.g., admin rights), whether the channel is permanent or deletable, rate limits, or what happens on success/failure. This is a significant gap for a mutation tool.

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 front-loads the core purpose ('Creates a new text channel') and includes key detail ('optional topic'). There is no wasted verbiage, making it appropriately sized for its content.

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?

Given the tool's complexity (a mutation with 3 parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects like permissions or error handling, and parameter semantics are largely undocumented, making it inadequate for safe and effective use.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It mentions 'optional topic' which maps to one parameter, but doesn't explain guildId (server ID) or channelName (naming rules/restrictions). With 3 parameters total and only one partially addressed, it adds minimal value beyond the bare schema.

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 ('Creates') and resource ('new text channel in a Discord server'), with the optional 'topic' providing some specificity. However, it doesn't differentiate from sibling tools like discord_create_category or discord_create_forum_post, which also create channels but of different types.

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?

No guidance is provided on when to use this tool versus alternatives. For example, it doesn't mention when to choose this over discord_create_category for organizing channels or discord_create_forum_post for forum-style discussions, leaving usage context implied but not explicit.

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

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