generate_presentation
Convert raw text or markdown into a presentation deck. Use notes, outlines, or summaries to create slides.
Instructions
Create a new presentation from raw text or markdown. Use this to turn notes, outlines, meeting summaries, or draft content into an Alai deck before polling get_generation_status.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input_text | Yes | The source content to transform into slides. | |
| title | No | Presentation title shown in the deck and exports. | |
| theme_id | No | Theme identifier from get_themes. Use this to control layout family. | |
| vibe_id | No | Visual style identifier from get_vibes. Use only after discovering valid IDs. | |
| language | No | Presentation language, for example English or Spanish. | |
| export_formats | No | Formats to generate when the deck is ready. | |
| slide_range | No | Requested slide count range such as 2-5. | |
| include_ai_images | No | Whether Alai should generate image content for slides. | |
| num_creative_variants | No | How many creative variants to generate per slide. | |
| total_variants_per_slide | No | Total variant count to generate for each slide. | |
| image_ids | No | Existing uploaded image identifiers to reuse in the deck. |
Implementation Reference
- src/index.js:154-161 (handler)The handler function for generate_presentation that forwards the call to the remote Alai MCP endpoint via callRemoteTool.
async (args) => { try { return await callRemoteTool("generate_presentation", args); } catch (error) { return normalizeError(error); } }, ); - src/index.js:120-152 (schema)Input schema for generate_presentation: requires input_text, and optionally accepts title, theme_id, vibe_id, language, export_formats, slide_range, include_ai_images, num_creative_variants, total_variants_per_slide, and image_ids.
inputSchema: { input_text: z .string() .min(1) .describe("The source content to transform into slides."), ...basePresentationInput, slide_range: z .string() .optional() .describe("Requested slide count range such as 2-5."), include_ai_images: z .boolean() .optional() .describe("Whether Alai should generate image content for slides."), num_creative_variants: z .number() .int() .min(0) .max(2) .optional() .describe("How many creative variants to generate per slide."), total_variants_per_slide: z .number() .int() .min(1) .max(4) .optional() .describe("Total variant count to generate for each slide."), image_ids: z .array(z.string()) .optional() .describe("Existing uploaded image identifiers to reuse in the deck."), }, - src/index.js:115-161 (registration)Registration of the generate_presentation tool on the MCP server via server.registerTool.
server.registerTool( "generate_presentation", { description: "Create a new presentation from raw text or markdown. Use this to turn notes, outlines, meeting summaries, or draft content into an Alai deck before polling get_generation_status.", inputSchema: { input_text: z .string() .min(1) .describe("The source content to transform into slides."), ...basePresentationInput, slide_range: z .string() .optional() .describe("Requested slide count range such as 2-5."), include_ai_images: z .boolean() .optional() .describe("Whether Alai should generate image content for slides."), num_creative_variants: z .number() .int() .min(0) .max(2) .optional() .describe("How many creative variants to generate per slide."), total_variants_per_slide: z .number() .int() .min(1) .max(4) .optional() .describe("Total variant count to generate for each slide."), image_ids: z .array(z.string()) .optional() .describe("Existing uploaded image identifiers to reuse in the deck."), }, }, async (args) => { try { return await callRemoteTool("generate_presentation", args); } catch (error) { return normalizeError(error); } }, ); - src/index.js:22-43 (helper)Helper function callRemoteTool that creates an MCP client, connects to the remote Alai endpoint, and calls the specified tool with the 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(() => {}); } }