You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`start_google_auth`| Complete | Legacy OAuth 2.0 auth (disabled when OAuth 2.1 is enabled) |
751
751
752
+
<details>
753
+
<summary><b>📎 Email Attachments</b> <sub><sup>← Send emails with files</sup></sub></summary>
754
+
755
+
Both `send_gmail_message` and `draft_gmail_message` support attachments via two methods:
756
+
757
+
**Option 1: File Path** (local server only)
758
+
```python
759
+
attachments=[{"path": "/path/to/report.pdf"}]
760
+
```
761
+
Reads file from disk, auto-detects MIME type. Optional `filename` override.
762
+
763
+
**Option 2: Base64 Content** (works everywhere)
764
+
```python
765
+
attachments=[{
766
+
"filename": "report.pdf",
767
+
"content": "JVBERi0xLjQK...", # base64-encoded
768
+
"mime_type": "application/pdf"# optional
769
+
}]
770
+
```
771
+
772
+
**⚠️ Centrally Hosted Servers**: When the MCP server runs remotely (cloud, shared instance), it cannot access your local filesystem. Use **Option 2** with base64-encoded content. Your MCP client must encode files before sending.
description='Optional list of attachments. Each can have: "path" (file path, auto-encodes), OR "content" (standard base64, not urlsafe) + "filename". Optional "mime_type". Example: [{"path": "/path/to/file.pdf"}] or [{"filename": "doc.pdf", "content": "base64data", "mime_type": "application/pdf"}]',
1007
+
),
922
1008
) ->str:
923
1009
"""
924
-
Sends an email using the user's Gmail account. Supports both new emails and replies.
1010
+
Sends an email using the user's Gmail account. Supports both new emails and replies with optional attachments.
925
1011
Supports Gmail's "Send As" feature to send from configured alias addresses.
926
1012
927
1013
Args:
928
1014
to (str): Recipient email address.
929
1015
subject (str): Email subject.
930
1016
body (str): Email body content.
931
1017
body_format (Literal['plain', 'html']): Email body format. Defaults to 'plain'.
1018
+
attachments (Optional[List[Dict[str, str]]]): Optional list of attachments. Each dict can contain:
1019
+
Option 1 - File path (auto-encodes):
1020
+
- 'path' (required): File path to attach
1021
+
- 'filename' (optional): Override filename
1022
+
- 'mime_type' (optional): Override MIME type (auto-detected if not provided)
1023
+
Option 2 - Base64 content:
1024
+
- 'content' (required): Standard base64-encoded file content (not urlsafe)
1025
+
- 'filename' (required): Name of the file
1026
+
- 'mime_type' (optional): MIME type (defaults to 'application/octet-stream')
932
1027
cc (Optional[str]): Optional CC email address.
933
1028
bcc (Optional[str]): Optional BCC email address.
934
1029
from_email (Optional[str]): Optional 'Send As' alias email address. The alias must be
description="Optional list of attachments. Each can have: 'path' (file path, auto-encodes), OR 'content' (standard base64, not urlsafe) + 'filename'. Optional 'mime_type' (auto-detected from path if not provided).",
1170
+
),
1046
1171
) ->str:
1047
1172
"""
1048
-
Creates a draft email in the user's Gmail account. Supports both new drafts and reply drafts.
1173
+
Creates a draft email in the user's Gmail account. Supports both new drafts and reply drafts with optional attachments.
1049
1174
Supports Gmail's "Send As" feature to draft from configured alias addresses.
0 commit comments