get_character
Retrieve detailed information about a specific character using their AniList ID or name, accessible via the AniList MCP server.
Instructions
Get information about a character by their AniList ID or name
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The AniList ID of the character |
Implementation Reference
- tools/people.ts:26-44 (handler)The handler function for the 'get_character' tool. It takes an ID or name, fetches the character data from AniList, and returns it as a formatted JSON string, with error handling.async ({ id }) => { try { const character = await anilist.people.character(id); return { content: [ { type: "text", text: JSON.stringify(character, null, 2), }, ], }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } }, );
- tools/people.ts:16-20 (schema)Input schema for the 'get_character' tool using Zod, accepting either a numeric ID or string name for the character.{ id: z .union([z.number(), z.string()]) .describe("The AniList ID of the character"), },
- tools/people.ts:14-44 (registration)Registration of the 'get_character' MCP tool within the registerPeopleTools function, including name, description, input schema, hints, and handler."get_character", "Get information about a character by their AniList ID or name", { id: z .union([z.number(), z.string()]) .describe("The AniList ID of the character"), }, { title: "Get Character Info", readOnlyHint: true, openWorldHint: true, }, async ({ id }) => { try { const character = await anilist.people.character(id); return { content: [ { type: "text", text: JSON.stringify(character, null, 2), }, ], }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } }, );