Skip to main content
Glama

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
NameRequiredDescriptionDefault
recommendIDYesThe AniList recommendation ID

Implementation Reference

  • 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, }; } },
  • Zod input schema defining the required 'recommendID' number parameter.
    { recommendID: z.number().describe("The AniList recommendation ID"), },
  • 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);

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