create_slide
Add a slide to an existing presentation using a text prompt, with options for classic content or creative visual layouts.
Instructions
Add a new slide to an existing presentation. Use this for targeted edits after a deck already exists, including classic content slides or more creative visually led slides.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| presentation_id | Yes | Target presentation that will receive the new slide. | |
| prompt | Yes | Instruction describing the content or intent of the new slide. | |
| slide_type | No | Choose classic for structured content or creative for more visual exploration. | |
| insert_after_slide_id | No | Existing slide identifier after which the new slide should be inserted. | |
| theme_id | No | Optional theme override for the new slide. | |
| vibe_id | No | Optional vibe override for the new slide. |
Implementation Reference
- src/index.js:232-271 (registration)Registration of the 'create_slide' tool with the MCP server, including description and input schema using Zod validation.
server.registerTool( "create_slide", { description: "Add a new slide to an existing presentation. Use this for targeted edits after a deck already exists, including classic content slides or more creative visually led slides.", inputSchema: { presentation_id: z .string() .min(1) .describe("Target presentation that will receive the new slide."), prompt: z .string() .min(1) .describe("Instruction describing the content or intent of the new slide."), slide_type: z .enum(["classic", "creative"]) .optional() .describe("Choose classic for structured content or creative for more visual exploration."), insert_after_slide_id: z .string() .optional() .describe("Existing slide identifier after which the new slide should be inserted."), theme_id: z .string() .optional() .describe("Optional theme override for the new slide."), vibe_id: z .string() .optional() .describe("Optional vibe override for the new slide."), }, }, async (args) => { try { return await callRemoteTool("create_slide", args); } catch (error) { return normalizeError(error); } }, ); - src/index.js:237-262 (schema)Input schema for the create_slide tool, defining presentation_id, prompt, slide_type, insert_after_slide_id, theme_id, and vibe_id with Zod validations.
inputSchema: { presentation_id: z .string() .min(1) .describe("Target presentation that will receive the new slide."), prompt: z .string() .min(1) .describe("Instruction describing the content or intent of the new slide."), slide_type: z .enum(["classic", "creative"]) .optional() .describe("Choose classic for structured content or creative for more visual exploration."), insert_after_slide_id: z .string() .optional() .describe("Existing slide identifier after which the new slide should be inserted."), theme_id: z .string() .optional() .describe("Optional theme override for the new slide."), vibe_id: z .string() .optional() .describe("Optional vibe override for the new slide."), }, - src/index.js:264-270 (handler)Handler function for create_slide that proxies the call to the remote Alai MCP endpoint via callRemoteTool.
async (args) => { try { return await callRemoteTool("create_slide", args); } catch (error) { return normalizeError(error); } }, - src/index.js:22-43 (helper)Generic helper function callRemoteTool that creates a temporary MCP client, connects to the remote Alai server, and calls the named 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(() => {}); } }