Skip to main content
Glama
wowjinxy
by wowjinxy

create_voice_channel

Create a new voice channel in a Discord server with customizable settings including name, category, user limit, and bitrate for organized communication.

Instructions

Create a new voice channel in the specified server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
server_idNo
category_idNo
user_limitNo
bitrateNo
reasonNo

Implementation Reference

  • The main handler function for the 'create_voice_channel' tool. It fetches the Discord guild, constructs keyword arguments from input (name, category_id, user_limit, bitrate, position), creates the voice channel using guild.create_voice_channel(**kwargs), and returns a success message with channel details.
    async def handle_create_voice_channel(discord_client, arguments: Dict[str, Any]) -> List[TextContent]:
        """Create a voice channel"""
        guild = await discord_client.fetch_guild(int(arguments["server_id"]))
        
        kwargs = {
            "name": arguments["name"],
            "reason": "Voice channel created via MCP"
        }
        
        if "category_id" in arguments:
            category = guild.get_channel(int(arguments["category_id"]))
            kwargs["category"] = category
        
        if "user_limit" in arguments:
            kwargs["user_limit"] = arguments["user_limit"]
        
        if "bitrate" in arguments:
            kwargs["bitrate"] = arguments["bitrate"]
        
        if "position" in arguments:
            kwargs["position"] = arguments["position"]
        
        channel = await guild.create_voice_channel(**kwargs)
        
        return [TextContent(
            type="text",
            text=f"Created voice channel '{channel.name}' (ID: {channel.id}) in {guild.name}"
        )]
  • Registration of the 'create_voice_channel' tool in the MCP server's list_tools() function, including name, description, and input schema definition.
    Tool(
        name="create_voice_channel",
        description="Create a voice channel with custom settings",
        inputSchema={
            "type": "object",
            "properties": {
                "server_id": {"type": "string", "description": "Server ID"},
                "name": {"type": "string", "description": "Channel name"},
                "category_id": {"type": "string", "description": "Optional category ID"},
                "user_limit": {"type": "number", "description": "User limit (0 for unlimited)"},
                "bitrate": {"type": "number", "description": "Audio bitrate"},
                "position": {"type": "number", "description": "Channel position"}
            },
            "required": ["server_id", "name"]
        }
    ),
  • Dynamic dispatch/registration logic in call_tool() that routes 'create_voice_channel' (as part of advanced_tool_names) to the corresponding handler method in AdvancedToolHandlers class.
    advanced_tool_names = [
        "edit_server_settings", "create_server_template", "create_channel_category",
        "create_voice_channel", "create_stage_channel", "create_forum_channel",
        "create_announcement_channel", "edit_channel", "set_channel_permissions",
        "create_role", "edit_role", "delete_role", "create_role_hierarchy",
        "create_emoji", "create_webhook", "send_webhook_message",
        "ban_member", "kick_member", "timeout_member", "bulk_delete_messages",
        "create_scheduled_event", "create_invite", "create_thread", "create_automod_rule"
    ]
    
    if name in advanced_tool_names:
        handler_method = f"handle_{name}"
        if hasattr(AdvancedToolHandlers, handler_method):
            return await getattr(AdvancedToolHandlers, handler_method)(discord_client, arguments)
  • Input schema definition for the 'create_voice_channel' tool, specifying parameters like server_id, name, category_id, user_limit, bitrate, and position.
    inputSchema={
        "type": "object",
        "properties": {
            "server_id": {"type": "string", "description": "Server ID"},
            "name": {"type": "string", "description": "Channel name"},
            "category_id": {"type": "string", "description": "Optional category ID"},
            "user_limit": {"type": "number", "description": "User limit (0 for unlimited)"},
            "bitrate": {"type": "number", "description": "Audio bitrate"},
            "position": {"type": "number", "description": "Channel position"}
        },
        "required": ["server_id", "name"]

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