Skip to main content
Glama
jabberjabberjabber

qBittorrent MCP Server

search_torrents

Find torrents by searching across multiple sources using qBittorrent's search plugins. Filter results by category including movies, TV shows, music, games, and software.

Instructions

Search for torrents using qBittorrent's search plugins.

Args: query: Search query string plugins: Comma-separated list of plugin names or "all" for all enabled plugins category: Filter by category (all, movies, tv, music, games, anime, software, pictures, books)

Returns: List of search results with torrent information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoall
pluginsNoall
queryYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • main.py:40-93 (handler)
    The main handler function for the 'search_torrents' tool. It is registered using the @mcp.tool() decorator and implements the torrent search logic using the qBittorrent API, including starting a search job, waiting for results, formatting them, and cleaning up.
    @mcp.tool()
    def search_torrents(query: str, plugins: str = "all", category: str = "all") -> list[dict[str, Any]]:
        """
        Search for torrents using qBittorrent's search plugins.
    
        Args:
            query: Search query string
            plugins: Comma-separated list of plugin names or "all" for all enabled plugins
            category: Filter by category (all, movies, tv, music, games, anime, software, pictures, books)
    
        Returns:
            List of search results with torrent information
        """
        client = get_qbt_client()
    
        # Start search
        search_job = client.search_start(pattern=query, plugins=plugins, category=category)
    
        # Get search job ID
        search_id = search_job.id
    
        # Wait for results (check status until complete or timeout)
        import time
        max_wait = 30  # seconds
        waited = 0
    
        while waited < max_wait:
            status = client.search_status(search_id=search_id)
            if status[0].status == "Stopped":
                break
            time.sleep(1)
            waited += 1
    
        # Get results
        results = client.search_results(search_id=search_id, limit=100)
    
        # Stop search
        client.search_delete(search_id=search_id)
    
        # Format results
        formatted_results = []
        for result in results.results:
            formatted_results.append({
                "name": result.fileName,
                "size": result.fileSize,
                "size_readable": f"{result.fileSize / (1024**3):.2f} GB",
                "seeders": result.nbSeeders,
                "leechers": result.nbLeechers,
                "url": result.fileUrl,
                "description_url": result.descrLink,
                "site": result.siteUrl
            })
    
        return formatted_results
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions using 'qBittorrent's search plugins' but doesn't detail behavioral traits such as rate limits, authentication needs, error handling, or what happens if plugins are disabled. The description is minimal and doesn't compensate for the lack of annotations, leaving key operational aspects unclear.

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

Conciseness4/5

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

The description is appropriately sized and front-loaded: the first sentence states the core purpose, followed by a structured 'Args' and 'Returns' section. Each sentence adds value without redundancy. It could be slightly more concise by integrating the sections more seamlessly, but overall, it's efficient and well-organized.

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?

Given the complexity (a search tool with 3 parameters), no annotations, 0% schema description coverage, but with an output schema (implied by 'Returns'), the description is moderately complete. It covers the basic function and parameters but lacks depth in behavioral context and usage guidelines. The output schema helps by specifying return values, but the description doesn't fully address the tool's operational nuances.

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?

The description adds some meaning beyond the input schema, which has 0% schema description coverage. It explains that 'query' is a 'Search query string', 'plugins' is a 'Comma-separated list of plugin names or "all" for all enabled plugins', and 'category' filters by specific categories. However, it doesn't fully compensate for the schema's lack of descriptions (e.g., no examples or constraints), so it meets the baseline for partial coverage.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Search for torrents using qBittorrent's search plugins.' It specifies the verb ('Search'), resource ('torrents'), and mechanism ('using qBittorrent's search plugins'), which is clear and specific. However, it doesn't explicitly differentiate from siblings like 'list_search_plugins' (which might list available plugins rather than search with them), leaving room for minor ambiguity.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention siblings like 'download_torrent' (for downloading after search) or 'list_search_plugins' (for checking available plugins), nor does it specify prerequisites (e.g., needing plugins enabled) or exclusions. Usage is implied only by the tool's name and basic function, lacking explicit context.

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

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