maket_gmail
Connect Gmail to search and read messages, download attachments, and compose drafts from Maket documents. Requires OAuth; drafts are reviewed and sent from Gmail.
Instructions
When to use: connect Gmail, search/read mail, download an attachment, or create a draft from a Maket document. All actions except connect require an active OAuth session — call connect first.
connect — restore the refresh token if present, otherwise open the browser for OAuth consent. Pass with_read=true to also request inbox access (drafts are always granted). search — list subject/from/date for messages matching a Gmail query. Capped at 50. Requires with_read=true at connect time. read — fetch one message by id: headers, body (3000-char truncated), attachments listing. Requires with_read=true at connect time. fetch_attachment — download one attachment (id + attachmentId from a prior read). Images land in the Maket asset library (validated, optimized, thumbnailed, metadata row). Other files (PDF, zip, docx, …) drop into /attachments/ untouched. Requires with_read=true at connect time. draft — compose a Gmail draft from a document page. Charte tokens resolve to literals, assets inline as base64, listed docs attach as PDFs. Maket never sends — the user reviews and sends from Gmail.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cc | No | For draft: cc. Falls back to doc.meta.emailCc. | |
| id | No | For read: Gmail message id (from search results). | |
| to | No | For draft: recipient. Falls back to doc.meta.emailTo when omitted. | |
| bcc | No | For draft: bcc. Falls back to doc.meta.emailBcc. | |
| doc | No | For draft: Maket document to use as the email body. | |
| page | No | For draft: 1-based page number within the document. | |
| query | No | For search: Gmail query (same syntax as the UI: from:, subject:, after:, etc.). | |
| action | Yes | Operation to run. See the tool description for the action table. | |
| quality | No | For draft: PDF quality preset for attachments. Default screen (smaller). | |
| subject | No | For draft: subject. Falls back to doc.meta.emailSubject. | |
| category | No | For fetch_attachment (image branch only): category tag saved with the asset row. Default email-attachment. | |
| filename | No | For fetch_attachment: override the saved filename. Defaults to the name reported by Gmail. | |
| overwrite | No | For fetch_attachment: replace an existing file (asset or non-image drop) when set. Default false. | |
| with_read | No | For connect: also request read access (inbox search + message read). Default false — Maket only creates drafts. | |
| maxResults | No | For search: cap on results. Default 10, max 50. | |
| attachments | No | For draft: names of other Maket docs to attach as PDFs. Falls back to doc.meta.emailAttachments. | |
| attachmentId | No | For fetch_attachment: Gmail attachment id from a previous action=read call. |