add_delegate
Grant email management access by adding a delegate to a Gmail account. This tool allows another user to send, read, and organize emails on your behalf.
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 executes the tool logic by calling the Gmail API to create a new delegate using the provided delegateEmail.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 defining the delegateEmail parameter for the add_delegate tool.{ delegateEmail: z.string().describe("Email address of delegate to add") },
- src/index.ts:962-973 (registration)Registration of the add_delegate tool using server.tool, including name, 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) }) } )