Email tools
Set up and run the email channel from an AI assistant, from sending domain to scheduled broadcasts.
The email tools let an assistant run your email channel end to end: connect a sending domain, write templates,
build automated emails such as abandoned checkout, schedule broadcasts to a segment and watch deliverability.
They are on the VYG agents server, not on https://api.vyg.app/mcp:
https://agents-mcp.vyg.app/mcpclaude mcp add --transport http vyg-email https://agents-mcp.vyg.app/mcpEmail must be enabled
The email tools appear only when email is enabled for your brand. Without it, the server lists none of them and refuses every call. Ask your VYG account manager to enable email.
Your assistant signs you in the first time it connects. Every tool works on the brand you signed in to; no tool
takes a brand id. Lists return up to 25 items by default and at most 100, with a next_cursor to pass back as
cursor for the next page.
A full setup, step by step
- Connect a sending domain.
email_domain_addreturns the DNS records to publish. After publishing them,email_domain_recheckconfirms the domain. Use a subdomain such asmail.yourstore.com. - Add your business address. Every marketing email must show a postal address.
email_brand_address_getshows what is on file andemail_brand_address_setsaves it. You can also set it in VYG under Settings → Email → Business address. - Write a template.
email_template_createsaves it live as soon as it passes the checks below.email_template_previewshows it with sample data andemail_template_test_sendsends one copy to your own inbox. - Build the automation.
email_flow_createwith thecheckout/abandonedtrigger and an Email step (or a Resend step) creates the flow paused.email_flow_activatestarts it. - Watch results.
email_send_list,email_deliverability_statsandemail_sending_status. - Broadcast to a segment.
email_segment_create, thenemail_broadcast_createwith a send time.email_broadcast_pausestops it at any time.
Example requests:
Connect mail.acme.com as our sending domain and tell me which DNS records to add.Create an abandoned checkout email that lists the cart items with images, send me a test, then turn it on
one hour after checkout is abandoned.Email everyone in the VIP segment our restock template next Tuesday at 9am New York time.Templates
email_template_create and email_template_update run the same checks before saving. If a check fails nothing
is saved and the assistant gets the list of problems to fix:
- a subject and an HTML body;
- an unsubscribe link whose address is
{{unsubscribe}}; - no
<script>tags,on…event handlers orjavascript:links; - an HTML body under 100 KB.
A missing postal address and unknown variables come back as warnings. Saved templates are live and can be used
by flows and broadcasts right away. Templates follow the same rules whether they are saved here or in VYG under
Settings → Email. Editing a template keeps its id, so everything that uses it picks up the change on its next
send. The version number goes up when a live template changes. An edit that would overwrite someone else's newer
save is refused, so the assistant reads the template again and retries. Pass expected_version to refuse the edit
whenever the template is no longer at the version the assistant read. email_template_archive retires a template:
anything still pointing at it stops sending until it uses a live template. Archived templates cannot be edited.
Variables
Write variables as {{name}} in the subject, body or plain text. email_template_variables_list returns this
list to the assistant.
| Variable | Fills in |
|---|---|
{{contact.first_name}} | Recipient's first name (blank when unknown) |
{{contact.last_name}} | Recipient's last name |
{{contact.email}} | Recipient's email address |
{{event.checkout_url}} | Link back to the abandoned checkout |
{{event.cart_total}} | Cart total with currency, such as $40.37 |
{{brand.name}} | Your brand name |
{{brand.support_email}} | Your support email |
{{brand.address}} | Your postal address on one line; put it in the footer |
{{brand.domain}} | Your store domain |
{{generated.unsubscribe_url}} | One-click unsubscribe link, filled in per recipient |
{{unsubscribe}} | Same unsubscribe link |
{{product.title}} | Product title |
{{product.variant_title}} | Variant, such as size or color |
{{product.price}} | Item price with currency |
{{product.image_url}} | Product image from your synced catalog |
{{product.product_url}} | Product page, or the checkout link when there is none |
To repeat a block for every item in the cart, wrap it in {{#each products}}…{{/each}}. Inside the block the
product.* variables refer to the current item. Outside a block they refer to the first item in the cart.
Business address
Anti-spam law requires every marketing email to show the sender's postal address, which templates add with
{{brand.address}}. email_flow_activate, email_broadcast_create and email_broadcast_resume refuse to go live
until your brand has one.
email_brand_address_set takes line1 (street address), city and country, which are required, plus optional
line2, region (state or province) and postal (postal or ZIP code). It replaces the whole address and returns
the line that emails will show, such as 100 Main St, Austin, TX 78701, US. Every part is trimmed and must be plain
text without < or >. If a part is missing or invalid, nothing is saved.
Automated flows
email_flow_create builds a flow with a trigger, an optional wait and one email step. The trigger is either a store
event, trigger_event (checkout/abandoned or order/delivered, which need a connected Shopify store), or one of
your Custom E-Com events, custom_event: { type }, such as hq_checkout_abandoned. Your own system sends those events
to VYG. If two providers define the same event type, add provider. For a brand without Shopify, the error lists its
custom event types.
The email step is one of:
- Email step. Sends a live VYG template from a verified domain. Pass
from_domain, or leave it out to use your first verified domain. - Resend step. Sends a template from your own Resend account. Pass the Resend template id, the from address
and
variable_mappingsfrom each Resend variable to a data path such ascontact.first_nameorevent.checkout_url. Resend must be connected in VYG.
New flows are saved paused. email_flow_activate checks that every Email step has a live template and a verified
domain and that your brand has a postal address, then starts the flow; if something is missing it changes nothing
and lists the problems. Starting a flow requires an active VYG subscription. email_flow_pause stops it.
email_flow_update_node changes the template, domain or Resend settings, also on a running flow.
email_flow_delete removes a paused flow or broadcast that has never sent anything. It stops for good at once and
disappears from the email tools. In VYG it stays listed as paused, with [Deleted] before its name.
Message variants are optional. email_flow_variant_add adds another live template that competes with the step's
own template, and better performers get more traffic over time. A step without variants sends its own template to
everyone.
Segments and broadcasts
A segment is either a list of up to 5,000 addresses or a customer-data condition, and it always contains only your
customers. email_broadcast_create sends a live template to a segment once at send_at, or repeatedly with
first_send_at and every_hours (24 or more). Only subscribed recipients are mailed; unsubscribed and
suppressed addresses are skipped. email_broadcast_pause stops a broadcast, including a send already in
progress, and email_broadcast_resume restarts it, optionally at a new time.
Monitoring
email_send_list: recent sends with recipient, status and the flow or broadcast that sent them. Test sends are left out unlessinclude_testsis true.email_deliverability_stats: delivery, bounce and complaint rates over the last 7 days, for the whole brand or one flow, plus any alarm that would pause sending.email_sending_status: each domain's verification, its daily warm-up limit and whether sending is paused. New domains start with a small daily limit that grows as they warm up.email_suppression_list: addresses that are never emailed, with the reason.email_catalog_status: whether your product catalog has synced, with product counts and the last error. Until the first sync completes,{{product.image_url}}is blank. The catalog refreshes automatically, andemail_catalog_sync_requestasks for a full sync sooner. The request is queued and runs within about 15 minutes. The current catalog stays in use until the new sync completes. A brand without a connected Shopify store has no catalog: both tools returnapplicable: false, and sending is not affected.
All email tools
| Tool | What it does | Reads or changes |
|---|---|---|
email_domain_list | Sending domains, status and DNS records | Reads only |
email_domain_add | Connect a domain and get its DNS records | Makes changes |
email_domain_recheck | Check DNS and update the domain status | Makes changes |
email_brand_address_get | Your business postal address | Reads only |
email_brand_address_set | Save your business postal address | Makes changes |
email_template_variables_list | Supported variables and what they fill in | Reads only |
email_template_list | Templates with status and version | Reads only |
email_template_get | One template in full | Reads only |
email_template_create | Save a new live template | Makes changes |
email_template_update | Edit a template in place | Makes changes |
email_template_archive | Retire a template | Makes changes |
email_template_preview | Render with sample data, without sending | Reads only |
email_template_test_send | Send one copy to your own email address | Sends an email to you |
email_flow_create | Build a paused flow with an Email or Resend step | Makes changes |
email_flow_list | Flows that send email | Reads only |
email_flow_get | One flow and its email steps | Reads only |
email_flow_update_node | Change an email step | Makes changes |
email_flow_activate | Start a flow | Makes changes |
email_flow_pause | Pause a flow | Makes changes |
email_flow_delete | Delete a paused flow or broadcast that never sent | Makes changes |
email_flow_variant_list | Variants on an Email step | Reads only |
email_flow_variant_add | Add a variant to an Email step | Makes changes |
email_segment_create | Create a segment | Makes changes |
email_segment_list | Segments | Reads only |
email_segment_bind_flow | Note that a flow uses a segment (does not send) | Makes changes |
email_segment_delete | Delete a segment | Makes changes |
email_broadcast_create | Schedule a broadcast | Makes changes |
email_broadcast_list | Broadcasts and their state | Reads only |
email_broadcast_get | One broadcast with send counts | Reads only |
email_broadcast_pause | Pause a broadcast | Makes changes |
email_broadcast_resume | Resume or reschedule a broadcast | Makes changes |
email_send_list | Recent sends | Reads only |
email_deliverability_stats | Delivery, bounce and complaint rates | Reads only |
email_sending_status | Domains, warm-up limits and pauses | Reads only |
email_suppression_list | Addresses that are never emailed | Reads only |
email_catalog_status | Product catalog sync status | Reads only |
email_catalog_sync_request | Queue a full product catalog sync | Makes changes |
Ask your assistant to show what it is about to change and to wait for your confirmation before it runs a tool that
makes changes, especially email_flow_activate and email_broadcast_create, which send to real customers.
Next steps
- Tool catalog for everything on
https://api.vyg.app/mcp - Other clients to connect clients other than Claude