-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Problem
When using gmail/gmail.users.messages.send, the type definitions show:
payload?: MessagePartwith nestedheadersandbody.dataraw?: stringdescribed as "RFC 2822 formatted and base64url encoded"
This led me down a rabbit hole of constructing proper MIME messages with CRLF line endings, base64url encoding, etc. — none of which worked.
Solution
Turns out the Toolcog bridge accepts simple top-level fields:
{
"to": "recipient@example.com",
"subject": "Hello",
"body": "Message content"
}This is much better UX, but it's not documented in the types.
Suggestion
Add these fields to the TypeScript interface or operation description:
interface GmailUsersMessagesSendRequestBody {
// Simple send (Toolcog extension)
to?: string;
cc?: string;
bcc?: string;
subject?: string;
body?: string;
// Standard Gmail API fields
raw?: string;
payload?: MessagePart;
// ...
}Or add a one-liner to the description: "For simple sends, use to, subject, and body fields directly."
Context
Discovered during a demo where I spent ~15 minutes trying various RFC 2822 encoding approaches before stumbling on the simple pattern.
Reactions are currently unavailable