get_torrent_details
Retrieve torrent details, including metadata and status, by specifying the torrent ID or infohash using the rqbit Torrent Client MCP API.
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'. Decorated with @mcp.tool() for registration. Calls RqbitClient.get_torrent_details and serializes to JSON or returns error.@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 in RqbitClient wrapper that performs the HTTP GET request to the rqbit API endpoint /torrents/{id_or_infohash}.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
- rqbit_client/mcp_server.py:42-51 (registration)Tool registration via @mcp.tool() decorator in FastMCP.@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)