favourite_manga
Manage your manga favorites on AniList by adding or removing titles using their unique ID. Requires login to update your preferences.
Instructions
[Requires Login] Favourite or unfavourite a manga by its ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The AniList ID of the manga to favourite/unfavourite |
Implementation Reference
- tools/media.ts:125-149 (handler)The handler function that implements the core logic of the 'favourite_manga' tool. It authenticates the user via requireAuth, toggles the favourite status of the specified manga ID using the AniList API, and returns a textual response indicating success or failure.async ({ id }) => { try { const auth = requireAuth(config.anilistToken); if (!auth.isAuthorized) { return auth.errorResponse; } const result = await anilist.media.favouriteManga(id); return { content: [ { type: "text", text: result ? `Successfully added manga with ID ${id} to favourites.` : `Manga 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:113-117 (schema)The input schema for the 'favourite_manga' tool, defining a required numeric 'id' parameter for the AniList manga ID.{ id: z .number() .describe("The AniList ID of the manga to favourite/unfavourite"), },
- tools/media.ts:110-150 (registration)The registration of the 'favourite_manga' tool with the MCP server, including name, description, input schema, tool hints, and handler function.server.tool( "favourite_manga", "[Requires Login] Favourite or unfavourite a manga by its ID", { id: z .number() .describe("The AniList ID of the manga to favourite/unfavourite"), }, { title: "Favourite/Unfavourite Manga", 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.favouriteManga(id); return { content: [ { type: "text", text: result ? `Successfully added manga with ID ${id} to favourites.` : `Manga with ID ${id} was removed from favourites or operation failed.`, }, ], }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } }, );