Send an email
well_send_messageSend one email to one or several people (a supplier, a customer, an accountant) from the user's own Gmail.
Use it when the user asks you to email, write to, or message someone else. To notify the user themselves, use well_send_notification instead.
to: a list of the recipients' email addresses, one entry per address. Use the addresses the user gave, or ones read from Well's records; never guess one. Ask the user when you do not have it. One email goes to all of them: do not call this tool once per recipient.ccandbcc: optional lists of addresses in copy and in blind copy. Fill them only when the user asked for a copy.subjectandbody: write them in the user's language, with what the user asked to say. The body is plain text; line breaks are kept.invoice_id: the id of an issued invoice, only when the user asks you to send that invoice or to chase its customer for it, and you hold its id from Well's records (an invoice you issued or read in this conversation). Well then records the email against the invoice and ends the body with a lasting link to the invoice's PDF, which the card shows: never write a link to the invoice in the body yourself. Leave it out for every other email, and never guess or invent an id. A draft invoice, or an invoice of another workspace, is refused before anything is sent.A sales invoice goes out once, then is chased at most once per lateness band (1 to 30, 31 to 60, 61 to 90, over 90 days late). When the result has code
invoice_already_sent, nothing was sent: tell the user when and to whom it already went, as the message says, and do not call this tool again on your own.send_again: set it to true only when the user knows the invoice already went out at this step (you told them, or they said so) and asks to send it again anyway, for example to a corrected address or as a copy the customer asked for. The card then says it sends the invoice again, and the user approves it there. Never set it on your own.
This call sends nothing. It returns an approval link: give it to the user and say the email goes out only after they open the link in Well, read it and approve it there. Never say the email was sent, and never call this tool again for the same email unless the user asks for a changed one: a changed email needs a new link.
When the result has code missing_send_scope or gmail_reconnect_required, Well cannot send from the user's Gmail yet: give the user the reconnect link from the message, and call this tool again with the same values once they say they reconnected. Never send the email another way.
When the result has code outlook_send_unsupported, the user's mailbox is Outlook and Well cannot send from it yet: say so, and offer the two ways the message names. Never say the email was sent.
When the token authorizes one workspace, call this directly — no workspace call is needed first. When it authorizes several, this read will not guess which one you mean: pass workspace_id on the call.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cc | No | Addresses in copy. | |
| to | Yes | The recipients' email addresses, one entry per address. | |
| bcc | No | Addresses in blind copy. | |
| body | Yes | The email body, in plain text. Line breaks are kept. | |
| subject | Yes | The email subject line. | |
| invoice_id | No | The id of the issued invoice this email sends. Omit it when the email is not about an invoice. | |
| send_again | No | True only when the user knows this invoice already went out at this step and asks to send it again anyway. | |
| workspace_id | No | Target workspace. Omit when the token authorizes one workspace. Required when it authorizes several — a write lands in exactly one workspace and this call would not say which. | |
| conversation_id | No | The conversation id returned by the previous Well result, in its meta under well/conversation_id, in its structuredContent, or in its JSON text block. Pass it back on every call in the same conversation, including a call a card makes, so the chosen workspace and the earlier answers still apply. It decides the conversation on its own: nothing the host states about the session replaces it. Omit it only on the first call of a conversation. | |
| idempotency_key | No | Optional client-supplied key. A retried write with the same key returns the original result instead of re-applying the operation. | |
| send_again_over | No | Set by Well, never by you: the send a send-again card repeats. | |
| workspace_scope | No | Restrict this call to the family: the token's primary workspace plus the company workspaces under it that you are a member of. Unrelated authorized workspaces drop out of the read; row reads merge across the family, while a per-workspace figure still reports exactly one workspace. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | missing_send_scope or gmail_reconnect_required when Gmail needs reconnecting; outlook_send_unsupported when the user's mailbox is Outlook; write_target_unreadable, invoice_not_issued or invoice_canceled when invoice_id cannot be used; invoice_already_sent when the invoice already went out at this step. | |
| link | No | The link that connects Gmail, when the user's mailbox is Outlook. | |
| error | No | Why no approval link was created, with the reconnect link when Gmail needs reconnecting. | |
| status | Yes | ||
| success | Yes | ||
| error_code | Yes | ||
| expires_at | Yes | ||
| approval_url | Yes | ||
| conversation_id | No | The conversation this result belongs to. Pass it back as the conversation_id argument on every later Well call in the same conversation. | |
| newly_connected | No | Tools that connected to this workspace since the last result and that no session was told about yet, oldest first. Present only when at least one tool is new. The connected-line rule says when to tell an entry; when it does, one line per entry, in the person's language: "<name> is connected.". Never fold several entries into one sentence. Each entry comes back once, on one result only: never repeat its line later. | |
| approval_required | Yes | ||
| resolved_workspace | No | The workspace that answered, when the caller named none and the token authorizes several. | |
| conversation_id_note | No | Present only when the server opened a fresh lane, stating that no choice recorded earlier was read. | |
| flow_action_offer_id | Yes | ||
| conversation_id_source | No | Where the conversation id came from: the host's own request meta, the caller's argument, or a fresh lane the server opened. |