Official scripts
Explore our curated collection of scripts
List Gmail inbox
List the messages on the first page of the Gmail inbox. Requires an authenticated mail.google.com session. Returns folder, total (the range line as rendered, e.g. "1–50 of 240") and rows of sender, subject, snippet, date plus the unread / starred / hasAttachment flags. Covers only the first inbox page (up to ~50 rows as Gmail renders it); there is no pagination. Be aware that the output requires at least one row, so a genuinely empty inbox is not representable and will surface as a failure rather than an empty list.
Send Gmail email
Send an email from the signed-in Gmail account, with a plain-text body and an optional single file attachment.
Get Gmail thread
Read a Gmail thread by its hex threadId (as returned by search_emails): subject plus every rendered message's from, fromEmail, to, date, plain-text body and attachment names. In long threads Gmail collapses older messages, so only rendered (expanded) messages are returned.
Forward Gmail thread
Forward an entire Gmail thread to one recipient, with an optional leading note. Takes the hex threadId that search_emails returns, and forwards the whole conversation inline rather than a single message. Returns forwarded, threadId and to. The thread must be on the first page of All Mail, newest-first, so older conversations cannot be reached this way.
Create a Gmail draft
Compose a Gmail message and save it as a draft without sending it. Takes to/cc/bcc, subject and body, and confirms the draft exists in Drafts afterward rather than trusting the compose window closing.
List Gmail labels / folders
List the Gmail labels and system folders visible to the account, with their unread counts where Gmail shows one. Distinguishes system folders (Inbox, Sent, Drafts, Spam, Bin...) from user-created labels.
Search Gmail
Search the signed-in Gmail with the native query syntax (from:, to:, subject:, has:attachment, after:/before:, labels…) and return matching threads: threadId (feed it to get_thread / reply_to_email), sender, senderEmail, subject, snippet, date, unread, starred, hasAttachment. Results are threads rather than individual messages, which is Gmail's own search granularity, and only the first page of results is returned (up to 50).
Trash Gmail thread
Move a Gmail thread to the Bin by its hex threadId. Acts from the list view. Returns trashed, threadId. The thread must be on the first page of All Mail (newest-first).
Mark Gmail thread as read
Mark a Gmail thread as read by its hex threadId. Returns read, threadId, the All Mail page it was found on, and already_read. Acts from the All Mail list, scanning the first 4 pages (~200 newest threads). Safe to repeat: a thread that is already read returns already_read:true without clicking anything. Waits for Gmail to persist the change rather than returning on the optimistic row restyling, so the mail really is read once the run ends.
Send a Gmail draft
Send an existing Gmail draft, identified by the id the drafts listing gives you. This delivers a real message and cannot be undone, so the draft's recipients and subject are read and reported back before and with the send, and a draft with no recipient is refused rather than attempted. Success is confirmed two ways: the draft leaves Drafts and the same conversation turns up in Sent. The conversation id is returned and is the same before and after sending, so the message can be found again afterwards.
Mark Gmail thread as unread
Mark a Gmail thread as unread by its hex threadId. Returns unread, threadId, the All Mail page it was found on, and already_unread. Acts from the All Mail list, scanning the first 4 pages (~200 newest threads). Safe to repeat: a thread that is already unread returns already_unread:true without clicking anything. Waits for Gmail to persist the change rather than returning on the optimistic row restyling, so the mail really is unread once the run ends.
Report Gmail thread as spam
Report a Gmail thread as spam by its hex threadId (moves it to Spam). Requires an authenticated mail.google.com session. Works from the All Mail list view and is locale-independent. Returns reportedSpam, threadId. Moving the thread to Spam also feeds Gmail's spam classifier for that sender, which undoing does not fully reverse. Pass `account` (authuser=) in a multi-account browser jar, or Gmail picks u/0 nondeterministically. The thread must be on the first page of All Mail (newest-first) — the script does not paginate, so an older thread will not be found. Senders with an unsubscribe link raise an extra "Report spam or unsubscribe?" dialog; the script confirms the spam branch and rejects the unsubscribe one, and throws rather than guessing on an unrecognised dialog shape.
List Gmail drafts
List the unsent drafts in the signed-in Gmail account, each with the identifier needed to open, edit or send it, plus its subject, preview text, whether it carries an attachment, and the date Gmail shows. Gmail's own draft total is returned alongside the number of drafts read, so a mailbox with more drafts than one screenful is visible as such rather than looking complete. An account with no drafts is a normal empty result, not an error. Note that the drafts list does not show who a draft is addressed to — Gmail puts the word "Draft" where the recipient would be — so recipients have to come from opening the draft itself.
unsubscribe_from_sender
Unsubscribe from a mailing list using Gmail's own unsubscribe control, which appears beside the sender on a message carrying a List-Unsubscribe header. Returns the sender it acted on, whether the control was present, and whether Gmail confirmed the request. This leaves the mailing list for real and cannot be undone from Gmail: confirm the exact sender with the user before running, and note that approval for one sender does not carry over to another. Senders with no unsubscribe control are reported rather than acted on, and the script never falls back to reporting spam.
Archive Gmail thread
Archive a Gmail thread by its hex threadId (removes it from the Inbox; it stays in All Mail). Returns archived, threadId, and the Inbox page it was found on. Acts on the thread's row in the Inbox list, scanning the first 4 Inbox pages (~200 newest threads), and confirms the row actually left the list rather than trusting a toast. If the thread is not in those pages it throws: it is then already archived (nothing to do) or older than that. It never acts from the conversation view, where Gmail's Archive control is offered whatever the thread's state and so cannot confirm anything.
Update a Gmail draft
Change the subject and/or body of an existing Gmail draft, identified by the id the drafts listing gives you. Whichever field you leave out keeps its current value; a field you pass replaces what was there rather than appending to it. The draft's current contents are read first, so asking for what it already says makes no change and says so. Gmail issues a draft a new id every time it is saved, so the id you passed in stops existing and the new one is returned — use that for any follow-up. The conversation id stays the same and is returned as the stable handle. Recipients are not touched by this script.
Create a Google Workspace user (Admin console)
Creates a new user in the Google Admin console (Workspace) under the domain of the given admin account: fills first/last name, primary email local-part, optional secondary (personal) email, submits with an auto-generated 16-char password, and optionally sends the native "set your password" login-instructions email to the secondary address. Returns the created email and generated password. The admin account must already be signed in to this browser, with a session recent enough that Google does not ask to confirm the password again — when it does, the script stops before touching anything and tells you to sign in once by hand.
Search Google Maps places
Search Google Maps for places matching a query, optionally near a location. Returns n, captured, and records with name, address, phone, website, rating, category, lat, lng, placeId, and placeUrl. placeId is the join key for get_place and get_place_reviews; rating, category, lat and lng can be null.
Get Google Maps place details
Get one Google Maps place/business details by placeId (canonical ChIJ... from search_places), place URL, or free-text name+location. Returns name, fullAddress, phone, website, instagram, category, rating, reviews, hours, plusCode, lat, lng, placeId, placeUrl, resolvedUrl, matched, elapsed_s. matched is false when it did not resolve; the free-text path falls back to the first search result, so it can resolve the wrong place. Business fields (rating/reviews/hours/category/lat/lng/plusCode) are null when the place does not expose them.
Get Google Maps place reviews
Get a Google Maps place's reviews by placeId. Returns n and reviews with author, authorMeta byline, rating, time, text, and reviewId. Returned in Google's default "most relevant" order, not by date; fewer than requested come back for places with few reviews.
Maps: Search Businesses
Search for businesses on Google Maps (anonymous, no login): name, category, address, phone, website, rating, reviews, GPS, place_id. Paginates via scrolling, controlled by the count argument.
Get Gemini chat messages
Full message transcript of one Gemini conversation by id, oldest to newest.
Get candidate message thread
Get the full email/message thread of one Welcome to the Jungle ATS candidate by reference, oldest first. Each message has direction (received = sent by the candidate, sent = recruiter/system), sender, plain-text body, subject, unread flag and date.
Share a Google Drive file
Grant, update, or revoke a specific email's access to a Drive file (with a viewer/commenter/editor role), or toggle the file's general link-sharing mode between restricted and anyone-with-the-link.
Postman login (Google SSO)
Log into Postman using your connected Google account. Signs in via Google's account chooser and lands on your Postman workspace.
