delete_torrent
Remove unwanted torrents and their associated files from the rqbit Torrent Client MCP server by specifying the torrent ID.
Instructions
Delete a torrent and its files.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| torrent_id | Yes |
Implementation Reference
- rqbit_client/mcp_server.py:66-76 (handler)MCP tool handler function for 'delete_torrent'. Decorated with @mcp.tool() for automatic registration. Calls RqbitClient.delete_torrent and handles response.@mcp.tool() async def delete_torrent(torrent_id: str) -> str: """Delete a torrent and its files.""" logger.info(f"Deleting torrent: {torrent_id}") result = await rqbit_client.delete_torrent(torrent_id) if isinstance(result, str): error = f"Error deleting torrent {torrent_id}: {result}" logger.error(error) return error return "Successfully deleted torrent " + torrent_id
- Helper method in RqbitClient wrapper that sends POST request to rqbit API endpoint /torrents/{id}/delete to delete the torrent.async def delete_torrent(self, id_or_infohash: str) -> None | str: """Delete a torrent and its files.""" return await self._safe_request("POST", f"/torrents/{id_or_infohash}/delete")