Skip to main content
Glama

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
NameRequiredDescriptionDefault
enabledYesWhether all incoming mail is automatically forwarded to another address
emailAddressYesEmail address to which messages should be automatically forwarded
dispositionYesThe state in which messages should be left after being forwarded

Implementation Reference

  • 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) })
  • 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) }) }

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/HitmanLy007/gmail-mcp'

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