openart_get_character
Retrieve detailed information about a character from OpenArt using its unique ID.
Instructions
Get details for a specific OpenArt character by ID.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Character ID |
Implementation Reference
- src/tools.ts:53-74 (handler)The getCharacter function is the handler for openart_get_character. It navigates to the character page on OpenArt, scrapes name, background story, and voice from the DOM, and returns the character details.
export async function getCharacter(id: string): Promise<Character & { background_story?: string; voice?: string }> { const page = await newPage(); try { await page.goto(`${BASE_URL}/character/${id}`); await page.waitForLoadState("networkidle"); // TODO: replace selectors const name = (await page.locator("h1").textContent())?.trim() || ""; const story = (await page.locator('[data-background-story]').textContent())?.trim(); const voice = (await page.locator('[data-voice]').textContent())?.trim(); return { id, name, url: `${BASE_URL}/character/${id}`, background_story: story, voice, }; } finally { await page.close(); } } - src/index.ts:30-39 (registration)Tool registration in the tools array with its name, description, inputSchema (requiring an 'id' string parameter), and annotations.
{ name: "openart_get_character", description: "Get details for a specific OpenArt character by ID.", inputSchema: { type: "object", properties: { id: { type: "string", description: "Character ID" } }, required: ["id"], }, annotations: { readOnlyHint: true, openWorldHint: true }, }, - src/index.ts:93-95 (registration)Request handler switch-case that routes 'openart_get_character' calls to the getCharacter function, parsing the 'id' argument with Zod.
case "openart_get_character": result = await getCharacter(z.object({ id: z.string() }).parse(args).id); break;