list_torrents
Get a full list of all torrents currently tracked by the rqbit torrent client, including their names, progress, and status.
Instructions
List all torrents.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- rqbit_client/mcp_server.py:17-25 (handler)The MCP tool handler for 'list_torrents'. It is registered via @mcp.tool() decorator, calls rqbit_client.list_torrents(), and returns the result as a JSON string.
@mcp.tool() async def list_torrents() -> str: """List all torrents.""" logger.info("Listing all torrents") result = await rqbit_client.list_torrents() if isinstance(result, str): logger.error(f"Error listing torrents: {result}") return f"Error listing torrents: {result}" return dumps(result) - The RqbitClient.list_torrents() method that makes the actual HTTP GET request to /torrents endpoint on the rqbit API server.
async def list_torrents(self) -> list[dict[str, Any]] | str: """list all torrents.""" return await self._safe_request("GET", "/torrents") # type: ignore - rqbit_client/mcp_server.py:17-17 (registration)The @mcp.tool() decorator registers list_torrents as an MCP tool with FastMCP.
@mcp.tool() - rqbit_client/mcp_server.py:18-18 (schema)The tool takes no arguments (no input schema) and returns a string (JSON-encoded list of torrents or error message).
async def list_torrents() -> str: