add_delegate
Grant email access by adding a delegate to manage your Gmail account, enabling shared inbox management and task delegation.
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)The handler function for the 'add_delegate' tool. It invokes the Gmail API to create a new delegate for the user's account using the provided delegate email.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)Zod schema defining the input parameters for the 'add_delegate' tool, requiring a delegateEmail string.{ delegateEmail: z.string().describe("Email address of delegate to add") },
- src/index.ts:962-973 (registration)MCP server tool registration for 'add_delegate', including description, input schema, and handler function.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) }) } )