Templates
CRUD tools for managing reusable email templates. Templates support Mustache syntax for dynamic content in both subject lines and bodies.createEmailTemplate
Create a new email template with name (max 200 chars), subject (max 1000 chars), body (max 50000 chars), and optional variables. Templates support Mustache syntax for dynamic content. Permission:emailTemplates:write
Parameters:
Returns: The created email template object.
getEmailTemplate
Get a specific email template by ID, including all template details. Permission:emailTemplates:read
Parameters:
Returns: The email template object, or
null if not found.
listEmailTemplates
List email templates for the organization with pagination. Supports filtering by status and name. Permission:emailTemplates:read
Parameters:
Returns:
updateEmailTemplate
Update an existing email template with new values for any template fields. Name max 200 chars, subject max 1000 chars, body max 50000 chars. Permission:emailTemplates:write
Parameters:
Returns: The updated email template object.
deleteEmailTemplate
Delete an email template (soft delete). Permission:emailTemplates:delete
Parameters:
Returns: The deleted email template object.
Render & send
Tools for rendering templates with variable data and dispatching templated emails through the organization’s email pipeline.renderEmailTemplate
Render an email template by ID with provided data variables using Mustache templating. Returns the rendered subject and the raw rendered body — the delivered email (seesendTemplatedEmail) additionally sanitizes the body
(unsafe markup removed) and wraps it in a standard email layout.
Permission: emailTemplates:read
Parameters:
Returns: Object with
subject and body strings containing the rendered
content.
sendTemplatedEmail
Render an email template with data and send it. Fetches the template, renders subject and body with the provided data, sanitizes the body (scripts, event handlers, and other unsafe markup are removed), wraps it in a standard email-client-compatible layout, auto-generates a plain-text alternative, and sends the email from the specified email address. Permission:emailTemplates.send:write (inherits from emailTemplates
unless set explicitly)
Parameters:
Returns: Object with
subject, to, from, rendered, sent and
skipped fields. skipped lists recipients the organization must not email,
each with a reason; they are left off the send. For marketing, a recipient
with no opt-in on record is skipped with reason not_opted_in. When no to recipient
remains, nothing is sent and sent is false — cc and bcc recipients
receive the message only alongside a to recipient.
A marketing send delivers a separate message to each to recipient, ending
with the business name, its mailing address and an unsubscribe link. to takes
at most 50 addresses after duplicates are removed; split a longer list across
calls. to in the result lists who was sent a message. Calling again after a
partial failure doesn’t send anyone a second copy.
Errors: the address is not found, disabled, a connected Gmail or Outlook
mailbox, on a domain whose email setup has not finished, or reserved for
another purpose; or, for marketing, cc or bcc is set, to has more than
50 addresses, or the business has no mailing address.
The same checks run again at the moment of delivery, so a send that this tool
accepts is still refused if the address, the agent’s permission, the
recipient’s status or their opt-in changes before the message leaves.
Marketing opt-ins
Marketing email reaches only addresses with a live opt-in: a record of how and when the person agreed, and where the proof is kept. Records can’t be edited; withdraw one and record it again to replace it. Recording an opt-in does not undo an unsubscribe.recordEmailMarketingOptIn
Record that a person agreed to receive the organization’s marketing email. Record only real, explicit agreement — never bought, scraped or cold-outreach addresses. Permission:emailTemplates.optIns:write. New agents ask before recording,
even when template writes are allowed.
Parameters:
Returns: The opt-in record, with
id, email, basis, source,
capturedOn, evidence, createdAt and withdrawnAt (null).
Errors: the address already has a live opt-in (the error names it), the
evidence is blank, or the date is in the future.
listEmailMarketingOptIns
List opt-in records, newest first. Withdrawn records are left out unless you ask for them. Permission:emailTemplates.optIns:read
Parameters:
Returns:
withdrawEmailMarketingOptIn
Withdraw an opt-in record, for example one recorded by mistake. Marketing email to that address stops, including messages already on their way, until a new opt-in is recorded. The record stays in the list as withdrawn. Permission:emailTemplates.optIns:write
Parameters:
Returns: The withdrawn record, with
withdrawnAt set.
Errors: no record with that ID, or it was already withdrawn.
Next steps
Email Address Tools
Discover which email addresses are available to send from
Authentication
Learn how MCP clients authenticate to the server