openart_get_video_status
Retrieve the rendering status and URL for an OpenArt video by providing its ID.
Instructions
Check the rendering status and URL of an OpenArt video by ID.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| video_id | Yes |
Implementation Reference
- src/tools.ts:142-164 (handler)The actual handler function `getVideoStatus` that checks rendering status and URL of an OpenArt video by ID. Navigates to the video page, scrapes status, video URL, thumbnail, and prompt from DOM.
export async function getVideoStatus(videoId: string): Promise<Video> { const page = await newPage(); try { await page.goto(`${BASE_URL}/video/${videoId}`); await page.waitForLoadState("networkidle"); // TODO: real selectors. const status = (await page.locator('[data-video-status]').getAttribute("data-status")) as Video["status"]; const videoUrl = await page.locator("video source").first().getAttribute("src"); const thumb = await page.locator('[data-video-thumbnail]').getAttribute("src"); const prompt = (await page.locator('[data-video-prompt]').textContent())?.trim(); return { id: videoId, status: status || "rendering", url: videoUrl || undefined, thumbnail_url: thumb || undefined, prompt, }; } finally { await page.close(); } } - src/tools.ts:17-23 (schema)The `Video` interface type definition used as the return type of `getVideoStatus`. Defines fields: id, status (queued/rendering/complete/failed), url, thumbnail_url, prompt.
export interface Video { id: string; status: "queued" | "rendering" | "complete" | "failed"; url?: string; thumbnail_url?: string; prompt?: string; } - src/index.ts:70-79 (registration)Tool registration in the tools array: defines name 'openart_get_video_status', description, inputSchema (video_id required string), and annotations.
{ name: "openart_get_video_status", description: "Check the rendering status and URL of an OpenArt video by ID.", inputSchema: { type: "object", properties: { video_id: { type: "string" } }, required: ["video_id"], }, annotations: { readOnlyHint: true, openWorldHint: true }, }, - src/index.ts:115-117 (registration)Tool handler dispatch in the CallToolRequestSchema switch statement: maps 'openart_get_video_status' to call `getVideoStatus` with the parsed video_id argument.
case "openart_get_video_status": result = await getVideoStatus(z.object({ video_id: z.string() }).parse(args).video_id); break; - src/index.ts:14-16 (registration)Import of the `getVideoStatus` function from ./tools.js at the top of index.ts.
getVideoStatus, cleanup, } from "./tools.js";