Skip to content

GMAIL tools: support multiple attachments (attachment field is singular object, not array) #2809

@ibbybuilds

Description

@ibbybuilds

Problem

All Gmail tools that accept file attachments (GMAIL_SEND_EMAIL, GMAIL_CREATE_EMAIL_DRAFT, GMAIL_REPLY_TO_THREAD) define the attachment parameter as a single object:

"attachment": {
  "type": "object",
  "properties": {
    "name": { "type": "string" },
    "mimetype": { "type": "string" },
    "s3key": { "type": "string" }
  }
}

This means users can only attach one file per email. There is no way to send an email with multiple attachments — a very common real-world need.

The Gmail API itself has zero limitation here — RFC 2822 MIME multipart/mixed supports unlimited attachment parts (up to the 25MB total size limit).

Requested Change

Add an attachments field (array of file objects) to all Gmail tools that accept files:

"attachments": {
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "name": { "type": "string" },
      "mimetype": { "type": "string" },
      "s3key": { "type": "string" }
    }
  }
}

Affected tools:

  • GMAIL_SEND_EMAIL
  • GMAIL_CREATE_EMAIL_DRAFT
  • GMAIL_REPLY_TO_THREAD

Also missing:

  • GMAIL_UPDATE_DRAFT — there is no tool to update an existing draft. This would be useful for incrementally building emails with multiple attachments, or editing drafts before sending.

Context

Workaround Attempted

We considered creating a draft with attachment A, then updating with attachment B — but drafts.update in Gmail API is a full PUT (replaces entire message), so previous attachments are lost. And the singular attachment field means we can't pass [A, B] anyway.

The only current workaround is using the proxy tool to construct raw MIME messages, which defeats the purpose of having high-level tool abstractions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions