Skip to main content
Glama

get_thread

Retrieve a specific thread from AniList by its unique ID using the dedicated API tool for streamlined data access.

Instructions

Get a specific thread by its AniList ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe AniList ID of the thread

Implementation Reference

  • Handler function that retrieves a specific AniList thread by ID using anilist.thread.get(id), returns the thread as JSON string, or an error message if failed.
    async ({ id }) => {
      try {
        const thread = await anilist.thread.get(id);
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(thread, null, 2),
            },
          ],
        };
      } catch (error: any) {
        return {
          content: [{ type: "text", text: `Error: ${error.message}` }],
          isError: true,
        };
      }
    },
  • Input schema defining the required 'id' parameter as a number with description.
    {
      id: z.number().describe("The AniList ID of the thread"),
    },
  • tools/thread.ts:55-83 (registration)
    Registration of the 'get_thread' tool on the MCP server, including name, description, input schema, metadata hints, and handler reference.
      "get_thread",
      "Get a specific thread by its AniList ID",
      {
        id: z.number().describe("The AniList ID of the thread"),
      },
      {
        title: "Get AniList Thread",
        readOnlyHint: true,
        openWorldHint: true,
      },
      async ({ id }) => {
        try {
          const thread = await anilist.thread.get(id);
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(thread, null, 2),
              },
            ],
          };
        } catch (error: any) {
          return {
            content: [{ type: "text", text: `Error: ${error.message}` }],
            isError: true,
          };
        }
      },
    );

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/yuna0x0/anilist-mcp'

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