favourite_anime
Mark or unmark an anime as a favorite using its AniList ID. Requires login to manage preferences directly through the AniList MCP server.
Instructions
[Requires Login] Favourite or unfavourite an anime by its ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The AniList ID of the anime to favourite/unfavourite |
Implementation Reference
- tools/media.ts:68-107 (registration)Registration of the 'favourite_anime' MCP tool, including description, input schema, metadata hints, and inline handler function that performs auth check and calls the external anilist.media.favouriteAnime(id)."favourite_anime", "[Requires Login] Favourite or unfavourite an anime by its ID", { id: z .number() .describe("The AniList ID of the anime to favourite/unfavourite"), }, { title: "Favourite/Unfavourite Anime", readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true, }, async ({ id }) => { try { const auth = requireAuth(config.anilistToken); if (!auth.isAuthorized) { return auth.errorResponse; } const result = await anilist.media.favouriteAnime(id); return { content: [ { type: "text", text: result ? `Successfully added anime with ID ${id} to favourites.` : `Anime with ID ${id} was removed from favourites or operation failed.`, }, ], }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } }, );
- tools/media.ts:82-106 (handler)The core handler logic for the 'favourite_anime' tool: checks authentication using requireAuth, toggles the anime favorite status via anilist.media.favouriteAnime(id), and returns success/error message.async ({ id }) => { try { const auth = requireAuth(config.anilistToken); if (!auth.isAuthorized) { return auth.errorResponse; } const result = await anilist.media.favouriteAnime(id); return { content: [ { type: "text", text: result ? `Successfully added anime with ID ${id} to favourites.` : `Anime with ID ${id} was removed from favourites or operation failed.`, }, ], }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } },
- tools/media.ts:70-74 (schema)Input schema using Zod: requires 'id' as a number (AniList anime ID).{ id: z .number() .describe("The AniList ID of the anime to favourite/unfavourite"), },