replyToMessage
Enable AI agents to reply to messages in specified inboxes using text or HTML, optionally including quoted replies, with automated inbox management via AgentMail.
Instructions
Reply to a message
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| html | No | ||
| inbox_id | Yes | ||
| include_quoted_reply | No | ||
| message_id | Yes | ||
| text | Yes |
Implementation Reference
- node/src/functions.ts:76-79 (handler)The handler function for the replyToMessage tool, which destructures arguments and calls the AgentMailClient's reply method.export async function replyToMessage(client: AgentMailClient, args: Args) { const { inbox_id, message_id, ...options } = args return client.inboxes.messages.reply(inbox_id, message_id, options) }
- node/src/tools.ts:84-89 (registration)Registration of the 'reply_to_message' tool in the tools array, associating name, description, schema, and handler function.{ name: 'reply_to_message', description: 'Reply to message', params_schema: ReplyToMessageParams, func: replyToMessage, },
- node/src/schemas.ts:55-57 (schema)Zod schema for ReplyToMessageParams, extending BaseMessageParams with required message_id field.export const ReplyToMessageParams = BaseMessageParams.extend({ message_id: MessageIdSchema, })
- The Python handler function for the reply_to_message tool, which calls the AgentMail client's reply method with kwargs.def reply_to_message(client: AgentMail, kwargs: Kwargs): return client.inboxes.messages.reply(**kwargs)
- python/src/agentmail_toolkit/tools.py:87-92 (registration)Registration of the 'reply_to_message' tool in the Python tools list, linking schema and handler.Tool( name="reply_to_message", description="Reply to message", params_schema=ReplyToMessageParams, func=reply_to_message, ),