Skip to main content
Glama
julien-nc

C411 MCP Server

by julien-nc

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
NameRequiredDescriptionDefault
infoHashYesThe 40-character hex infoHash of the torrent

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
sizeNo
tmdbNo
errorNo
filesNo
titleNo
trustNo
statusNo
seedersNo
successNo
categoryNo
infoHashYes
leechersNo
uploaderNo
createdAtNo
fileCountNo
sizeBytesNo
completionsNo
isExclusiveNo
isFreeleechNo
subcategoryNo
descriptionHtmlNo
lowBitrateWarningNo

Implementation Reference

  • 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';
  • 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);
      }
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/julien-nc/mcp-server-c411'

If you have feedback or need assistance with the MCP directory API, please join our Discord server