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
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The AniList ID of the studio to favourite/unfavourite |
Implementation Reference
- tools/misc.ts:28-52 (handler)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, }; } },
- tools/misc.ts:16-20 (schema)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, }; } }, );