add_delegate
Grant email access by adding a delegate to a specified Gmail account. Use this tool to assign permissions for managing emails, streamlining workflows with Gmail API integration.
Instructions
Adds a delegate to the specified account
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| delegateEmail | Yes | Email address of delegate to add |
Implementation Reference
- src/index.ts:967-972 (handler)Handler function for the 'add_delegate' tool that adds a delegate by calling the Gmail API's delegates.create method.async (params) => { return handleTool(config, async (gmail: gmail_v1.Gmail) => { const { data } = await gmail.users.settings.delegates.create({ userId: 'me', requestBody: { delegateEmail: params.delegateEmail } }) return formatResponse(data) }) }
- src/index.ts:964-966 (schema)Input schema definition for the 'add_delegate' tool, specifying the delegateEmail parameter.{ delegateEmail: z.string().describe("Email address of delegate to add") },
- src/index.ts:962-973 (registration)Registration of the 'add_delegate' MCP tool using server.tool(), including description, schema, and handler.server.tool("add_delegate", "Adds a delegate to the specified account", { delegateEmail: z.string().describe("Email address of delegate to add") }, async (params) => { return handleTool(config, async (gmail: gmail_v1.Gmail) => { const { data } = await gmail.users.settings.delegates.create({ userId: 'me', requestBody: { delegateEmail: params.delegateEmail } }) return formatResponse(data) }) } )