mail_send_message
Send an email message from the macOS Mail application. This tool transmits the most recently created message in your Mail app to its intended recipients.
Instructions
Send the most recently created message
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:1998-2037 (handler)Handler implementation for the 'mail_send_message' tool. It runs an AppleScript command via osascript to send the most recent outgoing message (first item in outgoing messages) in the Mail application.case 'mail_send_message': try { const command = `osascript -e 'tell application "Mail" set frontMessage to item 1 of (get outgoing messages) send frontMessage return "Message sent successfully" end tell'`; const { stdout, stderr } = await execAsync(command); if (stderr.trim()) { return { content: [ { type: 'text', text: `Error sending message: ${stderr.trim()}`, }, ], }; } return { content: [ { type: 'text', text: stdout.trim(), }, ], }; } catch (error: any) { return { content: [ { type: 'text', text: `Error executing mail send command: ${error.message}`, }, ], }; }
- src/index.ts:323-329 (registration)Tool registration in the ListTools response, defining name, description, and empty input schema for 'mail_send_message'.name: 'mail_send_message', description: 'Send the most recently created message', inputSchema: { type: 'object', properties: {}, }, },
- src/index.ts:323-329 (schema)Input schema definition for the 'mail_send_message' tool (no parameters required).name: 'mail_send_message', description: 'Send the most recently created message', inputSchema: { type: 'object', properties: {}, }, },