Skip to content

tool

The send_email Mastra tool: approval-gated so a model can draft a message freely but nothing leaves the building until a human clicks Approve in the chat UI. On approval the sender is resolved (explicit from config, else derived from the on-behalf-of user’s email) and the message is dispatched through the shared SMTP transport.

The sender derivation runs inside the AppKit user scope, so getExecutionContext() returns the OBO user whose local-part seeds the address (see deriveSenderAddress).

The dispatch itself goes through the executor the plugin installs on the shared runtime, so a send from this tool picks up the same retry / timeout / telemetry chain as one from the AppKit tool. In a Mastra app with no AppKit plugin registered the send still runs, just without interceptors.