get_forwarding_address
Retrieve a specific email forwarding address configured in Gmail to manage where incoming messages are redirected.
Instructions
Gets the specified forwarding address
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| forwardingEmail | Yes | The forwarding address to be retrieved |
Implementation Reference
- src/index.ts:1075-1080 (handler)The handler function for the 'get_forwarding_address' tool. It uses the handleTool wrapper to authenticate, create a Gmail client, call the Gmail API to get the forwarding address by email, and format the response.async (params) => { return handleTool(config, async (gmail: gmail_v1.Gmail) => { const { data } = await gmail.users.settings.forwardingAddresses.get({ userId: 'me', forwardingEmail: params.forwardingEmail }) return formatResponse(data) }) }
- src/index.ts:1072-1074 (schema)Zod schema defining the input parameters for the tool: forwardingEmail (string).{ forwardingEmail: z.string().describe("The forwarding address to be retrieved") },
- src/index.ts:1070-1081 (registration)Registration of the 'get_forwarding_address' tool on the MCP server, including name, description, input schema, and handler function.server.tool("get_forwarding_address", "Gets the specified forwarding address", { forwardingEmail: z.string().describe("The forwarding address to be retrieved") }, async (params) => { return handleTool(config, async (gmail: gmail_v1.Gmail) => { const { data } = await gmail.users.settings.forwardingAddresses.get({ userId: 'me', forwardingEmail: params.forwardingEmail }) return formatResponse(data) }) } )