Skip to main content
Glama
julien-nc

C411 MCP Server

by julien-nc

get_c411_torrent_comments

Retrieve user comments for torrents on c411.org by providing the torrent's infoHash, enabling community feedback review.

Instructions

Get comments for a c411.org torrent by its infoHash.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
infoHashYesThe 40-character hex infoHash of the torrent
pageNoComment page number. Defaults to 1.
limitNoNumber of comments per page. Defaults to 20.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageYes
errorNo
limitYes
totalNo
commentsYes
infoHashYes
totalPagesNo
resultCountYes

Implementation Reference

  • The implementation of the getTorrentComments method that fetches comments for a c411 torrent.
    async getTorrentComments(infoHash: string, page = 1, limit = 20): Promise<TorrentCommentsPage> {
      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 response = await this.getJsonWithAuthentication<C411ApiListResponse<unknown>>(
          `/api/torrents/${infoHash}/comments?page=${page}&limit=${limit}`,
          referer,
          'Torrent comments not found.',
          'Torrent comments lookup failed'
        );
    
        const comments = toTorrentComments(response?.data);
        return {
          infoHash,
          page,
          limit,
          ...(response?.meta?.total !== undefined ? { total: response.meta.total } : {}),
          ...(response?.meta?.totalPages !== undefined ? { totalPages: response.meta.totalPages } : {}),
          resultCount: comments.length,
          comments,
        };
      } catch (error) {
  • Registration of the get_c411_torrent_comments tool and the handler invoking the C411 client.
    server.registerTool('get_c411_torrent_comments', {
      description: 'Get comments for a c411.org torrent by its infoHash.',
      inputSchema: torrentCommentsToolSchema,
      outputSchema: torrentCommentsToolOutputSchema,
    }, async (args) => {
      try {
        const commentsPage = await client.getTorrentComments(args.infoHash, args.page, args.limit);
        return textWithStructuredContent(formatStructuredTorrentCommentsPage(commentsPage), commentsPage);
      } catch (error) {
        const message = error instanceof Error ? error.message : 'Torrent comments lookup failed';
        return errorContent(message, {
          infoHash: args.infoHash,
          page: args.page,
          limit: args.limit,

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