delete_channel
Remove unwanted Discord channels to manage server organization and reduce clutter by specifying the channel ID.
Instructions
Delete a Discord channel.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel_id | Yes | ||
| reason | No |
Implementation Reference
- The handler function that implements the delete_channel tool. It fetches the Discord channel using the provided channel_id, deletes it with an optional reason, and returns a confirmation message.@staticmethod 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}" )]
- src/discord_mcp/integrated_server.py:752-769 (registration)Registration of the delete_channel tool in the list_tools() function, including its name, description, and input schema definition.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"] } ),
- src/discord_mcp/integrated_server.py:1021-1032 (registration)The dispatch logic in call_tool() that routes 'delete_channel' calls to CoreToolHandlers.handle_delete_channel based on inclusion in core_tool_names list.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)
- Input schema definition for the delete_channel tool, specifying channel_id as required and reason as optional.inputSchema={ "type": "object", "properties": { "channel_id": { "type": "string", "description": "ID of channel to delete" }, "reason": { "type": "string", "description": "Reason for deletion" } }, "required": ["channel_id"]