Skip to main content
Glama

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
NameRequiredDescriptionDefault
bccNo
ccNo
htmlNo
inbox_idYes
subjectYes
textYes
toYes

Implementation Reference

  • 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)
  • 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")
  • 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,
    },
Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/agentmail-to/agentmail-toolkit'

If you have feedback or need assistance with the MCP directory API, please join our Discord server