Send a transactional or alert email on behalf of the agent
agent_send_emailSend real transactional email from autonomous workflows to notify humans or suppliers, compiling Markdown into responsive HTML and returning the provider message ID.
Instructions
Sends a real email from the suite's transactional sender: the Markdown body is compiled to responsive HTML (or raw html is sent as-is), with optional plain-text fallback and Reply-To, and the provider message id is returned. Use it when an autonomous workflow must notify a human or a supplier, for example a supplierAlert from br_nfe_xml_auditor or a risk alert. Do not use it for marketing or bulk mail, for messages that need attachments, or to test rendering (every successful call delivers a real message). Side effects: NOT read-only and NOT idempotent; each call sends a new email, so retry only when the previous call returned an error. Nothing is deleted or overwritten. Invalid recipients or a missing subject return success:false with error and message. Billing: 0.005 USDC per call. With X402_PRIVATE_KEY set, the server pays with x402 v2 on Base mainnet (eip155:8453) and refuses locally, before any request, when the price exceeds X402_MAX_USDC_PER_CALL (default 0.05). With BRAZIL_AI_API_KEY set, the call is debited from a prepaid B2B quota instead. With no credentials nothing is charged: the tool returns isError with error "payment_required_x402" plus the decoded paymentRequirements, so call brazil_ai_suite_status first to see the active payment mode. Errors never throw: a spend-cap block ("x402_spend_cap_exceeded"), a non-2xx API answer ({ status, endpoint, body }) or a network failure ("mcp_tool_execution_failed") comes back as an isError result with JSON text, so the agent loop keeps running.
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": {
"to": "<to>",
"subject": "<subject>"
},
"name": "agent_send_email"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Recipient address, or several separated by commas. Required. | |
| html | No | Optional raw HTML body; overrides the HTML compiled from markdown. | |
| text | No | Optional plain-text body, used as the text/plain part and as the body when no markdown or html is given. | |
| replyTo | No | Optional Reply-To address so replies go to a human instead of the sender. | |
| subject | Yes | Subject line, plain text. Required. | |
| markdown | No | Body in Markdown, compiled into responsive HTML. Provide markdown, text or html. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | Raw response body, present only when the API answered with non-JSON content (for example format=markdown). | |
| error | No | Stable machine-readable failure code, present only on failure. | |
| status | No | Delivery status reported by the provider, e.g. sent or queued. | |
| message | No | Human-readable explanation of the failure, present only on failure. | |
| subject | No | Subject actually sent. | |
| success | No | true when the provider accepted the message. | |
| provider | No | Email provider that handled the send. | |
| messageId | No | Provider message id, for tracking. | |
| recipients | No | Normalized recipient addresses. | |
| recipientCount | No | Number of recipients. | |
| _x402Settlement | No | x402 settlement receipt decoded from the PAYMENT-RESPONSE header (success flag, transaction hash, network, payer). Present only when the call was paid with an x402 wallet. | |
| processingTimeMs | No | Server-side processing time in milliseconds. | |
| renderedHtmlBytes | No | Size of the HTML body sent, in bytes. |