Skip to main content
Glama

get_recommendations_for_media

Retrieve personalized AniList media recommendations by providing a media ID, with options to paginate and limit results for efficient browsing.

Instructions

Get AniList recommendations for a specific media

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mediaIDYesThe AniList media ID
pageNoTarget a specific page number for recommendations
perPageNoLimit the page amount (max 25 per AniList limits)

Implementation Reference

  • The handler function that executes the tool: fetches AniList recommendations for a given media ID using pagination, returns JSON stringified response or error.
    async ({ mediaID, page, perPage }) => { try { const recommendationList = await anilist.recommendation.getList( mediaID, page, perPage, ); return { content: [ { type: "text", text: JSON.stringify(recommendationList, null, 2), }, ], }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } }, );
  • Input schema using Zod: requires mediaID, optional page (default 1) and perPage (default 25).
    { mediaID: z.number().describe("The AniList media ID"), page: z .number() .optional() .default(1) .describe("Target a specific page number for recommendations"), perPage: z .number() .optional() .default(25) .describe("Limit the page amount (max 25 per AniList limits)"), },
  • MCP server tool registration including name, description, input schema, metadata, and inline handler.
    server.tool( "get_recommendations_for_media", "Get AniList recommendations for a specific media", { mediaID: z.number().describe("The AniList media ID"), page: z .number() .optional() .default(1) .describe("Target a specific page number for recommendations"), perPage: z .number() .optional() .default(25) .describe("Limit the page amount (max 25 per AniList limits)"), }, { title: "Get AniList Recommendations for Media", readOnlyHint: true, openWorldHint: true, }, async ({ mediaID, page, perPage }) => { try { const recommendationList = await anilist.recommendation.getList( mediaID, page, perPage, ); return { content: [ { type: "text", text: JSON.stringify(recommendationList, 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