get_thread_comments
Retrieve comments from a specific AniList thread by providing the thread ID, page number, and comments per page. Simplify accessing thread discussions in a structured format.
Instructions
Get comments for a specific thread
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The AniList thread ID | |
| page | No | The page number | |
| perPage | No | How many comments per page |
Implementation Reference
- tools/thread.ts:103-120 (handler)Handler function that calls anilist.thread.getComments(id, page, perPage) to fetch comments and returns them as JSON text block, or error response.async ({ id, page = 1, perPage = 25 }) => { try { const comments = await anilist.thread.getComments(id, page, perPage); return { content: [ { type: "text", text: JSON.stringify(comments, null, 2), }, ], }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } },
- tools/thread.ts:89-97 (schema)Input schema using Zod: id (number, required), page (number, optional, default 1), perPage (number, optional, default 25).{ id: z.number().describe("The AniList thread ID"), page: z.number().optional().default(1).describe("The page number"), perPage: z .number() .optional() .default(25) .describe("How many comments per page"), },
- tools/thread.ts:86-121 (registration)Registers the 'get_thread_comments' tool on the MCP server, providing name, description, input schema, metadata hints, and handler function.server.tool( "get_thread_comments", "Get comments for a specific thread", { id: z.number().describe("The AniList thread ID"), page: z.number().optional().default(1).describe("The page number"), perPage: z .number() .optional() .default(25) .describe("How many comments per page"), }, { title: "Get AniList Thread Comments", readOnlyHint: true, openWorldHint: true, }, async ({ id, page = 1, perPage = 25 }) => { try { const comments = await anilist.thread.getComments(id, page, perPage); return { content: [ { type: "text", text: JSON.stringify(comments, null, 2), }, ], }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } }, );
- tools/index.ts:38-38 (registration)Calls registerThreadTools within registerAllTools to register all thread-related tools, including get_thread_comments.registerThreadTools(server, anilist, config);