update_imap
Configure IMAP access for Gmail accounts by enabling or disabling the protocol, setting expunge behavior for deleted messages, and managing folder size limits.
Instructions
Updates IMAP settings
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| enabled | Yes | Whether IMAP is enabled for the account | |
| expungeBehavior | No | The action that will be executed on a message when it is marked as deleted and expunged from the last visible IMAP folder | |
| maxFolderSize | No | An optional limit on the number of messages that can be accessed through IMAP |
Implementation Reference
- src/index.ts:901-914 (registration)Registration of the 'update_imap' MCP tool, including schema and handler function.server.tool("update_imap", "Updates IMAP settings", { enabled: z.boolean().describe("Whether IMAP is enabled for the account"), expungeBehavior: z.enum(['archive', 'trash', 'deleteForever']).optional().describe("The action that will be executed on a message when it is marked as deleted and expunged from the last visible IMAP folder"), maxFolderSize: z.number().optional().describe("An optional limit on the number of messages that can be accessed through IMAP") }, async (params) => { return handleTool(config, async (gmail: gmail_v1.Gmail) => { const { data } = await gmail.users.settings.updateImap({ userId: 'me', requestBody: params }) return formatResponse(data) }) } )
- src/index.ts:908-913 (handler)Handler for the 'update_imap' tool: invokes Gmail API to update IMAP settings using the provided parameters.async (params) => { return handleTool(config, async (gmail: gmail_v1.Gmail) => { const { data } = await gmail.users.settings.updateImap({ userId: 'me', requestBody: params }) return formatResponse(data) }) }
- src/index.ts:903-907 (schema)Input schema (Zod) for 'update_imap' tool parameters.{ enabled: z.boolean().describe("Whether IMAP is enabled for the account"), expungeBehavior: z.enum(['archive', 'trash', 'deleteForever']).optional().describe("The action that will be executed on a message when it is marked as deleted and expunged from the last visible IMAP folder"), maxFolderSize: z.number().optional().describe("An optional limit on the number of messages that can be accessed through IMAP") },