cancel_pipeline
Cancel an active torrent download by providing its infohash. Optionally delete associated files or require confirmation.
Instructions
Cancel an in-flight torrent. mutates: true
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| infohash | Yes | ||
| delete_files | No | ||
| confirm | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- Handler function for the cancel_pipeline MCP tool. Loads config, creates Qbittorrent client, and deletes the torrent by infohash, optionally removing files.
@mcp.tool(description="Cancel an in-flight torrent. mutates: true") @confirm_required("cancel_pipeline") def cancel_pipeline(infohash: str, delete_files: bool = False, confirm: bool = False) -> dict[str, Any]: cfg = _cfg.load() qb = Qbittorrent(cfg.qbittorrent) qb.delete(infohash, delete_files=delete_files) return {"ok": True, "infohash": infohash, "deleted_files": delete_files} - Tool schema/definition: accepts infohash (str), delete_files (bool, default False), confirm (bool, default False). Returns dict with ok, infohash, deleted_files.
@mcp.tool(description="Cancel an in-flight torrent. mutates: true") @confirm_required("cancel_pipeline") def cancel_pipeline(infohash: str, delete_files: bool = False, confirm: bool = False) -> dict[str, Any]: cfg = _cfg.load() qb = Qbittorrent(cfg.qbittorrent) qb.delete(infohash, delete_files=delete_files) return {"ok": True, "infohash": infohash, "deleted_files": delete_files} - src/lutris_source_mcp/tools/install_pipeline.py:176-177 (registration)Registered as an MCP tool via @mcp.tool decorator on the FastMCP instance from lutris_source_mcp.server.
@mcp.tool(description="Cancel an in-flight torrent. mutates: true") @confirm_required("cancel_pipeline") - src/lutris_source_mcp/tools/install_pipeline.py:194-194 (registration)Module exports including cancel_pipeline.
__all__ = ["prepare_install_source", "cancel_pipeline", "stop_seeding"] - Qbittorrent adapter delete method called by cancel_pipeline to delete the torrent via qBittorrent Web API.
def delete(self, infohash: str, *, delete_files: bool = False) -> None: self._request( "POST", "/api/v2/torrents/delete", data={"hashes": infohash.lower(), "deleteFiles": str(delete_files).lower()}, )