AI methods & callbacks

AI & MCP

AI methods & callbacks

What the AI assistant can do, and where each call runs.

  • generateDesignFromPrompt, build a full design from a prompt
  • editDesign, the conversational assistant (multi-turn edits)
  • rewriteText · generateSubjectLines · generateAltText
  • generateImage, generate an image for the image block

Wire these with a first-party adapter, or route them through your backend with email-craft-sdk so the provider key never reaches the browser.

Through the backend SDK the method names are camelCase (admin.ai("rewriteText", input)). For editDesign the editor sends { message, history, design_summary } and the SDK returns { operations, summary }; the editor applies the operations itself.