@uriva/p2b-gmail
1.0.1Skill
Description
Google Gmail utils using safescript..
Pending
tank install -g @uriva/p2b-gmailGmail Skill
Allows the bot to interact with the Gmail API to send emails and create drafts securely, with automatic RFC 1342 encoding of non-ASCII characters (e.g. Hebrew) in headers to prevent garbled text/mojibake.
Important Usage Rules
- Direct Callable Tools:
sendGmailEmailandcreateGmailDraftare exposed directly as callable tools. Call them directly as tools (or viarun_commandwith"gmail/sendGmailEmail"/"gmail/createGmailDraft"). Never writeimport { ... } from "./scripts/gmail.ss"insiderun_safescript. - Secret Prefix: Pass the configured secret name with the
SECRET:prefix asgoogleToken(for example"SECRET:GMAIL_ACCESS_TOKEN"or"SECRET:GOOGLE_ACCESS_TOKEN"). Uselist_env_variablesfromsecrets_and_variablesif you need to check which secret name is configured. - Reading / Searching Emails (Inbox): This skill is for sending and drafting emails (
gmail.sendscope). To read, list, or search incoming Gmail messages in the user's inbox, use thecomposioskill (list_composio_toolswithapp: "gmail",inspect_composio_tool, andexecute_composio_toolwithGMAIL_FETCH_EMAILSorGMAIL_FETCH_MESSAGE_BY_MESSAGE_ID).
All functions return { success, result, error }.
Example Tool Call
{
"googleToken": "SECRET:GMAIL_ACCESS_TOKEN",
"to": "[email protected]",
"subject": "הצעה להופעה אקוסטית",
"htmlBody": "<h1>היי!</h1><p>זהו גוף המייל.</p>"
}
Gmail Functions
sendGmailEmail(googleToken, to, subject, htmlBody)
Sends an HTML email directly through the Gmail API, properly encoding non-ASCII subject lines to avoid mojibake/garbled text.
googleToken: Secret reference for the Gmail OAuth token (e.g."SECRET:GMAIL_ACCESS_TOKEN").to: Recipient email address.subject: Email subject (automatically encoded to ASCII using UTF-8 Base64 RFC 1342).htmlBody: HTML content of the email body.
createGmailDraft(googleToken, to, subject, htmlBody)
Creates an email draft in the user's Gmail account, properly encoding non-ASCII subject lines to avoid mojibake/garbled text.
googleToken: Secret reference for the Gmail OAuth token (e.g."SECRET:GMAIL_ACCESS_TOKEN").to: Recipient email address.subject: Email subject (automatically encoded to ASCII using UTF-8 Base64 RFC 1342).htmlBody: HTML content of the email body.