Skip to main content
Glama

create_text_channel

Create a new text channel in a Discord server to organize conversations, specify topics, and categorize discussions for better community management.

Instructions

Create a new text channel in the specified server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
server_idNo
category_idNo
topicNo
reasonNo

Implementation Reference

  • The core handler function that executes the create_text_channel tool. It fetches the guild, prepares kwargs including name, optional category and topic, calls guild.create_text_channel, and returns a success message.
    @staticmethod async def handle_create_text_channel(discord_client, arguments: Dict[str, Any]) -> List[TextContent]: """Create a new text channel""" guild = await discord_client.fetch_guild(int(arguments["server_id"])) kwargs = { "name": arguments["name"], "reason": "Channel created via MCP" } if "category_id" in arguments: category = guild.get_channel(int(arguments["category_id"])) if category: kwargs["category"] = category if "topic" in arguments: kwargs["topic"] = arguments["topic"] channel = await guild.create_text_channel(**kwargs) return [TextContent( type="text", text=f"Created text channel '#{channel.name}' (ID: {channel.id}) in {guild.name}" )]
  • The MCP tool registration for 'create_text_channel', defining the tool name, description, and input schema with required server_id and name, optional category_id and topic.
    Tool( name="create_text_channel", description="Create a new text channel", inputSchema={ "type": "object", "properties": { "server_id": { "type": "string", "description": "Discord server ID" }, "name": { "type": "string", "description": "Channel name" }, "category_id": { "type": "string", "description": "Optional category ID to place channel in" }, "topic": { "type": "string", "description": "Optional channel topic" } }, "required": ["server_id", "name"] } ),
  • The input schema definition for the create_text_channel tool, specifying properties and requirements.
    inputSchema={ "type": "object", "properties": { "server_id": { "type": "string", "description": "Discord server ID" }, "name": { "type": "string", "description": "Channel name" }, "category_id": { "type": "string", "description": "Optional category ID to place channel in" }, "topic": { "type": "string", "description": "Optional channel topic" } }, "required": ["server_id", "name"] }
  • Routing logic in call_tool that dispatches 'create_text_channel' to CoreToolHandlers.handle_create_text_channel.
    core_tool_names = [ "get_server_info", "list_servers", "get_channels", "list_members", "get_user_info", "send_message", "read_messages", "add_reaction", "add_multiple_reactions", "remove_reaction", "moderate_message", "create_text_channel", "delete_channel", "add_role", "remove_role" ] if name in core_tool_names: handler_method = f"handle_{name}" if hasattr(CoreToolHandlers, handler_method): return await getattr(CoreToolHandlers, handler_method)(discord_client, arguments)

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

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