Skip to main content
Glama
philogicae

rqbit Torrent Client MCP

download_torrent

Initiate torrent downloads by providing a magnet link, HTTP URL, or local file path to the rqbit client.

Instructions

Download a torrent from a magnet link, HTTP URL, or local file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
magnet_link_or_url_or_pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The tool 'download_torrent' is registered as an MCP tool via the @mcp.tool() decorator. It handles downloading a torrent from a magnet link, HTTP URL, or local file path.
    @mcp.tool()
    async def download_torrent(magnet_link_or_url_or_path: str) -> str:
        """Download a torrent from a magnet link, HTTP URL, or local file."""
        logger.info(
            f"Downloading torrent from magnet link/HTTP URL/local file: {magnet_link_or_url_or_path}"
        )
        result = await rqbit_client.add_torrent(magnet_link_or_url_or_path)
        if isinstance(result, str):
            error = f"Error downloading torrent {magnet_link_or_url_or_path}: {result}"
            logger.error(error)
            return error
        return dumps(result)
  • The handler function 'download_torrent' accepts a magnet link, HTTP URL, or file path, logs the request, calls rqbit_client.add_torrent(), and returns the result as a JSON string or an error message.
    @mcp.tool()
    async def download_torrent(magnet_link_or_url_or_path: str) -> str:
        """Download a torrent from a magnet link, HTTP URL, or local file."""
        logger.info(
            f"Downloading torrent from magnet link/HTTP URL/local file: {magnet_link_or_url_or_path}"
        )
        result = await rqbit_client.add_torrent(magnet_link_or_url_or_path)
        if isinstance(result, str):
            error = f"Error downloading torrent {magnet_link_or_url_or_path}: {result}"
            logger.error(error)
            return error
        return dumps(result)
  • The 'add_torrent' method on RqbitClient is the helper that the tool delegates to. It POSTs to /torrents?&overwrite=true (with &is_url=true if the input starts with 'http'), sending either file contents or the raw URL string as the request body.
    async def add_torrent(
        self, url_or_path: str, content: bytes | None = None
    ) -> dict[str, Any] | str:
        """Add a torrent from a magnet, HTTP URL, or local file."""
        url = "/torrents?&overwrite=true"
        if url_or_path.startswith("http"):
            url += "&is_url=true"
        if content:
            return await self._safe_request("POST", url, content=content)  # type: ignore
        if os.path.exists(url_or_path):
            try:
                with open(url_or_path, "rb") as f:
                    return await self._safe_request("POST", url, content=f.read())  # type: ignore
            except FileNotFoundError:
                return f"Error: File not found at {url_or_path}"
            except IOError as e:
                return f"Error reading file {url_or_path}: {e}"
        return await self._safe_request("POST", url, content=url_or_path)  # type: ignore
  • The tool's schema is implicitly defined by the function signature: it takes a single string parameter 'magnet_link_or_url_or_path' and returns a string.
    @mcp.tool()
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, and the description lacks disclosure of side effects (e.g., immediate download start) or prerequisites (e.g., running client). For an ingestion tool, more behavioral context is needed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core action and resources. No extraneous text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite having an output schema, the description does not mention return values or success/failure behavior. Basic operational context (e.g., whether this adds to a queue) is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, but the description adds value by naming three input formats (magnet, URL, file). However, it does not provide format details or constraints, leaving some ambiguity.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the action 'Download a torrent' and specifies three source types (magnet link, HTTP URL, or local file), clearly distinguishing it from sibling tools like delete or start.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description is clear on what the tool does but provides no guidance on when to use it versus alternatives like start_torrent or when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/philogicae/rqbit-mcp'

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