Function: emailTool()
emailTool(
opts?):Tool<{attachments?:object[];bcc?:string[];body:string;cc?:string[];subject:string;to:string[]; }, {from:string;messageId?:string;recipient:string;sent:boolean; },unknown,unknown,ToolExecutionContext<unknown,unknown,unknown>,string,unknown>
Build the approval-gated send_email tool. Spread it into the agents
that should be able to draft mail; it is intentionally not installed
everywhere.
Parameters
Section titled “Parameters”EmailToolOptions = {}
Returns
Section titled “Returns”Tool<{ attachments?: object[]; bcc?: string[]; body: string; cc?: string[]; subject: string; to: string[]; }, { from: string; messageId?: string; recipient: string; sent: boolean; }, unknown, unknown, ToolExecutionContext<unknown, unknown, unknown>, string, unknown>
Example
Section titled “Example”import { emailTool } from "@dbx-tools/email";import { createAgent } from "@dbx-tools/appkit-mastra";
const support = createAgent({ instructions: "...", tools: () => ({ send_email: emailTool() }),});