update_auto_forwarding
Configure automatic email forwarding rules to redirect incoming messages to another address while managing message disposition in your Gmail account.
Instructions
Updates automatic forwarding settings
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| enabled | Yes | Whether all incoming mail is automatically forwarded to another address | |
| emailAddress | Yes | Email address to which messages should be automatically forwarded | |
| disposition | Yes | The state in which messages should be left after being forwarded |
Implementation Reference
- src/index.ts:860-864 (handler)Inline handler function for the update_auto_forwarding tool. It invokes the Gmail API's users.settings.updateAutoForwarding method via the handleTool wrapper, passing the input parameters as the request body, and formats the response.async (params) => { return handleTool(config, async (gmail: gmail_v1.Gmail) => { const { data } = await gmail.users.settings.updateAutoForwarding({ userId: 'me', requestBody: params }) return formatResponse(data) })
- src/index.ts:856-858 (schema)Zod schema defining the input parameters for the update_auto_forwarding tool: enabled (boolean), emailAddress (string), disposition (enum).enabled: z.boolean().describe("Whether all incoming mail is automatically forwarded to another address"), emailAddress: z.string().describe("Email address to which messages should be automatically forwarded"), disposition: z.enum(['leaveInInbox', 'archive', 'trash', 'markRead']).describe("The state in which messages should be left after being forwarded")
- src/index.ts:853-865 (registration)Registration of the update_auto_forwarding tool on the MCP server using server.tool(), including description, input schema, and inline handler function.server.tool("update_auto_forwarding", "Updates automatic forwarding settings", { enabled: z.boolean().describe("Whether all incoming mail is automatically forwarded to another address"), emailAddress: z.string().describe("Email address to which messages should be automatically forwarded"), disposition: z.enum(['leaveInInbox', 'archive', 'trash', 'markRead']).describe("The state in which messages should be left after being forwarded") }, async (params) => { return handleTool(config, async (gmail: gmail_v1.Gmail) => { const { data } = await gmail.users.settings.updateAutoForwarding({ userId: 'me', requestBody: params }) return formatResponse(data) }) }