Skip to main content
Glama
jabberjabberjabber

qBittorrent MCP Server

delete_torrent

Remove torrents from qBittorrent client with option to delete associated downloaded files, freeing up storage space and managing download queue.

Instructions

Delete a torrent from qBittorrent.

Args: torrent_hash: Hash of the torrent to delete delete_files: Also delete downloaded files (default: False)

Returns: Status message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
delete_filesNo
torrent_hashYes

Implementation Reference

  • main.py:260-282 (handler)
    The delete_torrent tool handler, decorated with @mcp.tool() for registration, implements deletion of a torrent from qBittorrent, optionally deleting files, using the qBittorrent client.
    @mcp.tool()
    def delete_torrent(torrent_hash: str, delete_files: bool = False) -> dict[str, str]:
        """
        Delete a torrent from qBittorrent.
    
        Args:
            torrent_hash: Hash of the torrent to delete
            delete_files: Also delete downloaded files (default: False)
    
        Returns:
            Status message
        """
        client = get_qbt_client()
    
        try:
            client.torrents_delete(delete_files=delete_files, torrent_hashes=torrent_hash)
            return {
                "status": "success",
                "message": f"Torrent {torrent_hash} deleted (files deleted: {delete_files})"
            }
        except Exception as e:
            return {"status": "error", "message": str(e)}

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/jabberjabberjabber/qbit-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server