check_aeo_content_suite_status
Monitor the status of content suite generation by polling for completion or failure, using the order ID from the initial generation request.
Instructions
Poll Content Suite generation. After generate_aeo_content_suite returns (HTTP 202), call every 15–30s until status is completed or failed. Same X-API-Key as generate.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| orderId | Yes | orderid returned from generate_aeo_content_suite |
Implementation Reference
- src/index.ts:217-261 (handler)The tool 'check_aeo_content_suite_status' is registered and implemented in src/index.ts. It polls the API to check the status of a Content Suite generation job using an orderId.
server.tool( "check_aeo_content_suite_status", "Poll Content Suite generation. After generate_aeo_content_suite returns (HTTP 202), call every 15–30s until status is completed or failed. Same X-API-Key as generate.", { orderId: z.string().describe("orderid returned from generate_aeo_content_suite"), }, async ({ orderId }) => { try { const oid = orderId.trim(); if (!oid) { return { content: [{ type: "text" as const, text: "Error: orderId is required" }], isError: true, }; } const res = await fetch(`${API_BASE}/api/aeo-content-status/${encodeURIComponent(oid)}`, { method: "GET", headers: { "X-API-Key": apiKey }, }); const data = (await res.json()) as Record<string, unknown>; if (!res.ok) { const err = (data?.error as string) || (data?.message as string) || `HTTP ${res.status}`; return { content: [{ type: "text" as const, text: `Error: ${err}\n\n${JSON.stringify(data, null, 2)}` }], isError: true, }; } const status = (data?.status as string) ?? "unknown"; const downloadUrl = data?.download_url as string | null | undefined; let text = `orderid: ${data?.orderid ?? oid}\n` + `status: ${status}\n` + (downloadUrl ? `download_url: ${downloadUrl}\n` : "") + `\nWhen status is **completed**, GET the ZIP with the same X-API-Key (see download_url).\n\n` + `Raw response:\n${JSON.stringify(data, null, 2)}`; return { content: [{ type: "text" as const, text }] }; } catch (err) { const msg = err instanceof Error ? err.message : String(err); return { content: [{ type: "text" as const, text: `Error: ${msg}` }], isError: true, }; } } );