Skip to main content
Glama
wowjinxy
by wowjinxy

delete_channel

Remove a Discord channel from a server using its ID. Specify a reason for the deletion if needed.

Instructions

Delete a Discord channel.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channel_idYes
reasonNo

Implementation Reference

  • Executes the deletion of a Discord channel by fetching it via ID and calling delete() with optional reason, returning a formatted success message.
    async def handle_delete_channel(discord_client, arguments: Dict[str, Any]) -> List[TextContent]:
        """Delete a channel"""
        channel = await discord_client.fetch_channel(int(arguments["channel_id"]))
        channel_name = channel.name
        guild_name = channel.guild.name
        
        await channel.delete(reason=arguments.get("reason", "Channel deleted via MCP"))
        
        return [TextContent(
            type="text",
            text=f"Deleted channel '#{channel_name}' from {guild_name}"
        )]
  • Registers the delete_channel tool with the MCP application, defining its name, description, and input schema.
    Tool(
        name="delete_channel",
        description="Delete a channel",
        inputSchema={
            "type": "object",
            "properties": {
                "channel_id": {
                    "type": "string",
                    "description": "ID of channel to delete"
                },
                "reason": {
                    "type": "string",
                    "description": "Reason for deletion"
                }
            },
            "required": ["channel_id"]
        }
    ),
  • Routes tool calls for delete_channel and other core tools to their handler methods in the CoreToolHandlers class.
    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