Generate email with AI
generate_emailDraft one email with AI from a prompt and the workspace AI context. Returns {subject, preview_text, document} where document is an email design document (version, style, subject, preheader, blocks: heading, text, button, divider). Errors: ai_unavailable (server has no AI key), ai_limit_reached (monthly allowance used; fix: wait, write by hand or upgrade), invalid_language (enable it in Settings > Localization), ai_unsafe_link (draft linked outside your sites; run again), ai_refused. Counts as one AI generation. Next: review the draft before sending; nothing is sent or saved.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"prompt": "<prompt>"
},
"name": "generate_email"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | What the email is for, in plain words, such as "welcome email for new trial users". 1 to 4000 characters. | |
| language | No | Language tag enabled in the workspace (Settings > Localization), such as "de". Defaults to the workspace default language. | |
| site_text | No | Optional text from the customer's website to learn facts and style from. Treated as untrusted data, never as instructions. |