Skip to content

Mail

Markdown

The owner’s own mail, read live from every Gmail account they connected through Roadstar. Nothing is copied unless the owner turns on search.

  • search and read work on every connected account.
  • draft makes a draft in the owner’s Gmail and sends nothing.
  • send sends from the owner’s Gmail. It is checked first, and it leaves after a two-minute Undo on Home.

Drafting and sending need the owner’s connection to allow writing. Until it does, they return error reauth, and a card asks the owner to connect again. See errors.

attach takes Drive files by id (Google files go as PDFs), attachments by their id from search, and workspace files by path, 25 MB in all.

Where search is on, search and read here cover only what search’s copy doesn’t hold yet. Once every account is copied whole, mail keeps only draft and send, and its how-to says so.

What find_tools sends with these tools, word for word:

The owner’s mail, such as Gmail, searched live. A thread reads as its messages without quoted text; attachments read like files. Gmail’s web links don’t open here: search by sender and subject. Gmail: Gmail’s query takes its search box syntax, and results come back newest first.

Tool What it does Owner’s yes
mail.search Threads, newest first, across the owner’s mail accounts, each with everyone on it but the owner; query takes the mail’s own search words, such as in:sent; dates as YYYY-MM-DD. nextPage, passed as page, gives older threads No
mail.read A thread’s messages with sender, recipients, date and text, and its attachments. With an attachment’s id, that file’s text. No
mail.draft Make a draft in the owner’s Gmail, in its thread when replying. Sends nothing. No
mail.send Send an email from the owner’s Gmail. It goes after a two-minute Undo. Checked

mail.search · Threads, newest first, across the owner’s mail accounts, each with everyone on it but the owner; query takes the mail’s own search words, such as in:sent; dates as YYYY-MM-DD. nextPage, passed as page, gives older threads.

Owner’s yes: No. Nothing of the owner’s changes.

Input Type Required What it is Limits
query text no up to 500 characters
from text no up to 200 characters
to text no up to 200 characters
after text no up to 40 characters
before text no up to 40 characters
hasAttachment true or false no
source text no Only accounts whose name contains this, e.g. an email address up to 120 characters
limit whole number no 1–20, default 10
page text no up to 4,000 characters

Returns:

{
nextPage?: string;
hits: (Hit & {
source: string;
})[];
searched: string[];
failed: Failure[];
}

mail.read · A thread’s messages with sender, recipients, date and text, and its attachments. With an attachment’s id, that file’s text.

Owner’s yes: No. Nothing of the owner’s changes.

Input Type Required Limits
id text yes 3–500 characters
attachment text no up to 300 characters
offset whole number no 0 or more

Returns:

Content & {
id: string;
source: string;
nextOffset?: number;
}

mail.draft · Make a draft in the owner’s Gmail, in its thread when replying. Sends nothing.

Owner’s yes: No. It makes something new.
Your work: listed on Home.

Input Type Required What it is Limits
to list of email address no up to 20 items, each up to 200 characters, default []
cc list of email address no up to 20 items, each up to 200 characters
subject text yes up to 300 characters
text text yes up to 20,000 characters
threadId text no To reply in a thread: its id from search up to 300 characters
replyAll true or false no Answer everyone on the thread
attach list of { file } or { email?, attachment } or { workspace } no Drive files (Google files go as PDFs), attachments by their id from search, or workspace files by path, 25 MB in all up to 10 items
signature true or false no false leaves off the owner’s Gmail signature

Returns:

{
draftId: string;
threadId: string;
to: string[];
}

mail.send · Send an email from the owner’s Gmail. It goes after a two-minute Undo.

Owner’s yes: Checked. It sends outside the business. It can also carry a note for the check to weigh.
Your work: listed on Home, with Undo.

Input Type Required What it is Limits
to list of email address no up to 20 items, each up to 200 characters, default []
cc list of email address no up to 20 items, each up to 200 characters
subject text yes up to 300 characters
text text yes 1–20,000 characters
threadId text no To reply in a thread: its id from search up to 300 characters
replyAll true or false no Answer everyone on the thread
attach list of { file } or { email?, attachment } or { workspace } no Drive files (Google files go as PDFs), attachments by their id from search, or workspace files by path, 25 MB in all up to 10 items
signature true or false no false leaves off the owner’s Gmail signature

Returns:

{
held: {
trigger: number;
at: string;
to: string[];
};
threadId: string;
note: string;
}

Named types in the results above.

type Hit = {
id: string;
title: string;
type: string;
who?: string;
people?: string[];
date?: string;
snippet?: string;
url: string;
}
type Failure = {
source: string;
kind: "not_connected" | "reauth" | "forbidden" | "not_found" | "rate_limited" | "unavailable" | "too_large" | "unsupported" | "bad_input" | "vendor" | "changed" | "unknown_outcome";
message: string;
integration: string;
connection: string;
}
type Content = {
title: string;
url: string;
text: string;
attachments?: Attachment[];
items?: Hit[];
nextPage?: string;
image?: {
mimeType: string;
data: string;
};
note?: string;
}
type Attachment = {
id: string;
name: string;
size: number;
}