create_forwarding_address
Enables users to set up an email forwarding address for redirecting messages from Gmail to a specified destination email.
Instructions
Creates a forwarding address
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| forwardingEmail | Yes | An email address to which messages can be forwarded |
Implementation Reference
- src/index.ts:1082-1087 (handler)Handler function that executes the tool logic by calling Gmail API to create a forwarding address.async (params) => { return handleTool(config, async (gmail: gmail_v1.Gmail) => { const { data } = await gmail.users.settings.forwardingAddresses.create({ userId: 'me', requestBody: params }) return formatResponse(data) }) }
- src/index.ts:1079-1081 (schema)Zod schema defining the input parameters for the create_forwarding_address tool.{ forwardingEmail: z.string().describe("An email address to which messages can be forwarded") },
- src/index.ts:1077-1087 (registration)Registration of the create_forwarding_address tool on the MCP server, including schema and inline handler.server.tool("create_forwarding_address", "Creates a forwarding address", { forwardingEmail: z.string().describe("An email address to which messages can be forwarded") }, async (params) => { return handleTool(config, async (gmail: gmail_v1.Gmail) => { const { data } = await gmail.users.settings.forwardingAddresses.create({ userId: 'me', requestBody: params }) return formatResponse(data) }) }