get_genres
Retrieve a comprehensive list of all available genres on AniList for precise categorization and streamlined content discovery.
Instructions
Get all available genres on AniList
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- tools/misc.ts:65-82 (handler)Handler function for the 'get_genres' tool. Fetches all available genres using the AniList client's genres() method, returns the JSON-stringified list in a text content block, or an error message if failed.async () => { try { const genres = await anilist.genres(); return { content: [ { type: "text", text: JSON.stringify(genres, null, 2), }, ], }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } },
- tools/misc.ts:56-83 (registration)Registration of the 'get_genres' tool using server.tool. Defines name, description, empty input schema, read-only metadata, and attaches the handler function.server.tool( "get_genres", "Get all available genres on AniList", {}, { title: "Get Genres", readOnlyHint: true, openWorldHint: true, }, async () => { try { const genres = await anilist.genres(); return { content: [ { type: "text", text: JSON.stringify(genres, null, 2), }, ], }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } }, );