get_generation_status
Check the status of an asynchronous presentation generation job to determine if it completed or failed.
Instructions
Check the status of an asynchronous presentation generation job. Use this after generate_presentation until the status reaches completed or failed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| generation_id | Yes | Generation job identifier returned by generate_presentation. |
Implementation Reference
- src/index.js:163-182 (registration)Registration of the 'get_generation_status' tool via server.registerTool, including its schema (input: generation_id) and a handler that delegates to callRemoteTool.
server.registerTool( "get_generation_status", { description: "Check the status of an asynchronous presentation generation job. Use this after generate_presentation until the status reaches completed or failed.", inputSchema: { generation_id: z .string() .min(1) .describe("Generation job identifier returned by generate_presentation."), }, }, async (args) => { try { return await callRemoteTool("get_generation_status", args); } catch (error) { return normalizeError(error); } }, ); - src/index.js:168-173 (schema)Input schema for the tool: requires a single string parameter 'generation_id' (min length 1).
inputSchema: { generation_id: z .string() .min(1) .describe("Generation job identifier returned by generate_presentation."), }, - src/index.js:175-181 (handler)Handler function for get_generation_status that calls the remote tool via callRemoteTool with error normalization.
async (args) => { try { return await callRemoteTool("get_generation_status", args); } catch (error) { return normalizeError(error); } }, - src/index.js:22-43 (helper)The callRemoteTool helper that creates an MCP client, connects to the remote Alai endpoint, and calls the named tool with provided arguments.
async function callRemoteTool(name, args) { const client = new Client( { name: "alai-mcp-wrapper", version: "1.0.2" }, { capabilities: {} }, ); const transport = new StreamableHTTPClientTransport(new URL(REMOTE_MCP_URL), { requestInit: { headers: createRemoteHeaders(), }, }); try { await client.connect(transport); return await client.callTool({ name, arguments: args, }); } finally { await transport.close().catch(() => {}); await client.close().catch(() => {}); } } - src/index.js:51-72 (helper)The normalizeError helper that formats upstream errors into a standard MCP error response.
function normalizeError(error) { const message = error instanceof Error ? error.message : "Unknown upstream error"; return { content: [ { type: "text", text: `Alai upstream request failed: ${message}`, }, ...(authGuidance() ? [ { type: "text", text: authGuidance(), }, ] : []), ], isError: true, }; }