Skip to main content
Glama

favourite_studio

Mark or unmark a studio as favourite on AniList using its unique ID. Requires login to manage your preferred studios efficiently.

Instructions

[Requires Login] Favourite or unfavourite a studio by its ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe AniList ID of the studio to favourite/unfavourite

Implementation Reference

  • The handler function that implements the core logic of the 'favourite_studio' tool. It performs authentication, calls the external AniList library's favouriteStudio method with the provided studio ID, and returns a formatted text response indicating success or failure.
    async ({ id }) => {
      try {
        const auth = requireAuth(config.anilistToken);
        if (!auth.isAuthorized) {
          return auth.errorResponse;
        }
    
        const result = await anilist.favouriteStudio(id);
        return {
          content: [
            {
              type: "text",
              text: result
                ? `Successfully added studio with ID ${id} to favourites.`
                : `Studio 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 to validate the 'id' parameter as a number, with a descriptive annotation.
    {
      id: z
        .number()
        .describe("The AniList ID of the studio to favourite/unfavourite"),
    },
  • tools/misc.ts:13-53 (registration)
    The registration of the 'favourite_studio' tool on the MCP server, specifying name, description, input schema, hints, and handler function.
    server.tool(
      "favourite_studio",
      "[Requires Login] Favourite or unfavourite a studio by its ID",
      {
        id: z
          .number()
          .describe("The AniList ID of the studio to favourite/unfavourite"),
      },
      {
        title: "Favourite/Unfavourite Studio",
        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.favouriteStudio(id);
          return {
            content: [
              {
                type: "text",
                text: result
                  ? `Successfully added studio with ID ${id} to favourites.`
                  : `Studio with ID ${id} was removed from favourites or operation failed.`,
              },
            ],
          };
        } 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