list_torrents
Retrieve a comprehensive list of all active torrents directly from the rqbit API. Monitor and manage downloads efficiently with this straightforward tool.
Instructions
List all torrents.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- rqbit_client/mcp_server.py:17-25 (handler)MCP tool handler for 'list_torrents': decorated with @mcp.tool(), calls RqbitClient.list_torrents(), handles errors, and returns 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)
- Core helper method in RqbitClient that performs the HTTP GET request to '/torrents' endpoint to list all torrents, with error handling via _safe_request.async def list_torrents(self) -> list[dict[str, Any]] | str: """list all torrents.""" return await self._safe_request("GET", "/torrents") # type: ignore