get_c411_torrent_info
Retrieve detailed torrent metadata from c411.org using a 40-character infoHash to access file information and specifications.
Instructions
Get detailed metadata for a c411.org torrent by its infoHash.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| infoHash | Yes | The 40-character hex infoHash of the torrent |
Output Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | ||
| tmdb | No | ||
| error | No | ||
| files | No | ||
| title | No | ||
| trust | No | ||
| status | No | ||
| seeders | No | ||
| success | No | ||
| category | No | ||
| infoHash | Yes | ||
| leechers | No | ||
| uploader | No | ||
| createdAt | No | ||
| fileCount | No | ||
| sizeBytes | No | ||
| completions | No | ||
| isExclusive | No | ||
| isFreeleech | No | ||
| subcategory | No | ||
| descriptionHtml | No | ||
| lowBitrateWarning | No |
Implementation Reference
- src/register-tools.ts:53-65 (handler)Registration of the 'get_c411_torrent_info' tool and the definition of its handler function.
server.registerTool('get_c411_torrent_info', { description: 'Get detailed metadata for a c411.org torrent by its infoHash.', inputSchema: torrentInfoToolSchema, outputSchema: torrentInfoToolOutputSchema, }, async (args) => { try { const detail = await client.getTorrentInfo(args.infoHash); return textWithStructuredContent(formatStructuredTorrentDetail(detail), { success: true, ...detail, }); } catch (error) { const message = error instanceof Error ? error.message : 'Torrent lookup failed'; - src/c411-client.ts:370-395 (handler)The actual implementation of the tool's logic, which calls the c411 API to retrieve torrent metadata.
async getTorrentInfo(infoHash: string): Promise<TorrentDetail> { if (!infoHash || !/^[a-fA-F0-9]{40}$/.test(infoHash)) { throw new Error('Invalid infoHash. Must be a 40-character hex string.'); } try { const referer = `${this.baseUrl}/torrents/${infoHash}`; const torrentResponse = await this.getJsonWithAuthentication<unknown>( `/api/torrents/${infoHash}`, referer, 'Torrent not found.', 'Torrent lookup failed' ); const detail = toStructuredTorrentDetail(torrentResponse); if (!detail) { throw new Error('Torrent lookup returned an unexpected response format.'); } return detail; } catch (error) { const message = getSafeErrorMessage(error, this.requestTimeoutMs); console.error(`Error fetching torrent info: ${message}`); throw new Error(message); } }