get_torrent_details
Retrieve detailed information for a torrent using its ID or infohash to monitor progress, check status, and view metadata.
Instructions
Get details for a specific torrent by its ID or infohash.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| torrent_id | Yes |
Implementation Reference
- rqbit_client/mcp_server.py:42-51 (handler)MCP tool handler for 'get_torrent_details'. Registers the tool and implements the logic by delegating to RqbitClient.get_torrent_details and serializing the result to JSON string.@mcp.tool() async def get_torrent_details(torrent_id: str) -> str: """Get details for a specific torrent by its ID or infohash.""" logger.info(f"Getting details for torrent: {torrent_id}") result = await rqbit_client.get_torrent_details(torrent_id) if isinstance(result, str): error = f"Error getting torrent details {torrent_id}: {result}" logger.error(error) return error return dumps(result)
- Core implementation of get_torrent_details in RqbitClient wrapper. Makes HTTP GET request to rqbit API endpoint /torrents/{id} and handles errors.async def get_torrent_details(self, id_or_infohash: str) -> dict[str, Any] | str: """Get details for a specific torrent.""" return await self._safe_request("GET", f"/torrents/{id_or_infohash}") # type: ignore