get_recommendation
Retrieve AniList recommendations by ID using the MCP server for accessing AniList API data. Find specific recommendations quickly with this targeted tool.
Instructions
Get an AniList recommendation by its ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| recommendID | Yes | The AniList recommendation ID |
Implementation Reference
- tools/recommendation.ts:22-39 (handler)The async handler function that fetches the AniList recommendation by ID using the anilist client and returns the JSON stringified data or an error message.async ({ recommendID }) => { try { const recommendation = await anilist.recommendation.get(recommendID); return { content: [ { type: "text", text: JSON.stringify(recommendation, null, 2), }, ], }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } },
- tools/recommendation.ts:14-16 (schema)Zod input schema defining the required 'recommendID' number parameter.{ recommendID: z.number().describe("The AniList recommendation ID"), },
- tools/recommendation.ts:12-40 (registration)Registers the 'get_recommendation' tool on the MCP server with description, input schema, metadata, and handler."get_recommendation", "Get an AniList recommendation by its ID", { recommendID: z.number().describe("The AniList recommendation ID"), }, { title: "Get AniList Recommendation by ID", readOnlyHint: true, openWorldHint: true, }, async ({ recommendID }) => { try { const recommendation = await anilist.recommendation.get(recommendID); return { content: [ { type: "text", text: JSON.stringify(recommendation, null, 2), }, ], }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } }, );
- tools/index.ts:36-36 (registration)Invokes registerRecommendationTools within the registerAllTools function to register all recommendation tools including 'get_recommendation'.registerRecommendationTools(server, anilist);