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
| Name | Required | Description | Default |
|---|---|---|---|
| channel_id | Yes | ||
| reason | No |
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}" )]
- src/discord_mcp/integrated_server.py:752-769 (registration)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"] } ),
- src/discord_mcp/integrated_server.py:1021-1032 (registration)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)