Skip to main content
Glama

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
NameRequiredDescriptionDefault
idYesThe 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,
          };
        }
      },
    );
  • 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,
        };
      }
    },
  • 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"),
    },

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