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
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_genres"
}
}Input 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, }; } }, );