sendMessage
Send messages securely within isolated inboxes on AgentMail. Specify recipients, subject, text, and optional HTML for AI agents to communicate effectively.
Instructions
Send a message
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bcc | No | ||
| cc | No | ||
| html | No | ||
| inbox_id | Yes | ||
| subject | Yes | ||
| text | Yes | ||
| to | Yes |
Implementation Reference
- node/src/functions.ts:71-74 (handler)Handler function that sends a message using the AgentMailClient by calling client.inboxes.messages.send.export async function sendMessage(client: AgentMailClient, args: Args) { const { inbox_id, ...options } = args return client.inboxes.messages.send(inbox_id, options) }
- Handler function that sends a message using the AgentMail client by calling client.inboxes.messages.send.def send_message(client: AgentMail, kwargs: Kwargs): return client.inboxes.messages.send(**kwargs)
- node/src/schemas.ts:48-53 (schema)Zod schema for SendMessage parameters, extending BaseMessageParams with to, cc, bcc, and subject fields.export const SendMessageParams = BaseMessageParams.extend({ to: z.array(z.string()).describe('Recipients'), cc: z.array(z.string()).optional().describe('CC recipients'), bcc: z.array(z.string()).optional().describe('BCC recipients'), subject: z.string().optional().describe('Subject'), })
- Pydantic model for SendMessage parameters, inheriting from BaseMessageParams with to, cc, bcc, and subject fields.class SendMessageParams(BaseMessageParams): to: List[str] = Field(description="Recipients") cc: Optional[List[str]] = Field(description="CC recipients") bcc: Optional[List[str]] = Field(description="BCC recipients") subject: Optional[str] = Field(description="Subject")
- node/src/tools.ts:78-83 (registration)Registration of the send_message tool in the tools array, linking schema and handler function.{ name: 'send_message', description: 'Send message', params_schema: SendMessageParams, func: sendMessage, },