Skip to main content
Glama

search_character

Find characters on AniList by entering a search term, specifying page number, and results per page (max 25).

Instructions

Search for characters based on a query term

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountNoResults per page (max 25)
pageNoPage number for results
termYesSearch term for finding characters

Implementation Reference

  • The handler function for the 'search_character' tool. It performs the search using the AniList client's searchEntry.character method and returns the results as JSON or an error message.
    async ({ term, page, amount }) => { try { const results = await anilist.searchEntry.character(term, page, amount); return { content: [ { type: "text", text: JSON.stringify(results, null, 2), }, ], }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } },
  • Zod input schema defining parameters for the 'search_character' tool: term (required string), page and amount (optional numbers with defaults).
    { term: z.string().describe("Search term for finding characters"), page: z .number() .optional() .default(1) .describe("Page number for results"), amount: z .number() .optional() .default(5) .describe("Results per page (max 25)"), },
  • Registration of the 'search_character' tool via server.tool(), including name, description, input schema, metadata hints, and handler function.
    server.tool( "search_character", "Search for characters based on a query term", { term: z.string().describe("Search term for finding characters"), page: z .number() .optional() .default(1) .describe("Page number for results"), amount: z .number() .optional() .default(5) .describe("Results per page (max 25)"), }, { title: "AniList Character Search", readOnlyHint: true, openWorldHint: true, }, async ({ term, page, amount }) => { try { const results = await anilist.searchEntry.character(term, page, amount); return { content: [ { type: "text", text: JSON.stringify(results, null, 2), }, ], }; } 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