> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hired.tools/llms.txt
> Use this file to discover all available pages before exploring further.

# Gmail and Calendar tools

> Six tools that read the threads and meetings in your own Google account behind any contact, company, application or resume — live, read-only, never copied.

The pipeline's timeline only knows what was logged by hand. These tools know what actually
happened: the recruiter's reply, the interview on the calendar, the rejection that came in
on a Saturday. `list_correspondence` is the one to reach for first — pass a contact, company,
application or resume id and it works out what to match on.

<Info>
  Everything here is **read-only and live**. The app asks Google when a tool is called and
  shows what came back; nothing from an inbox or a calendar is ever written to the instance.
  None of these tools can send, accept, archive or delete anything, because the permission
  Google was asked for does not allow it.
</Info>

Connecting is a consent screen at Google, so it cannot be done by tool: it is **Settings →
Google** in the app. `get_google_connection` says whether that has happened and which of the
two — Gmail, Calendar — was granted. An instance needs a Google OAuth client for any of this
to exist; see [Google sign-in](/self-hosting/google), which the same client provides.

How a record is matched:

| Record      | Matched on                                                          |
| ----------- | ------------------------------------------------------------------- |
| Contact     | Their email address.                                                |
| Company     | The domain of its website, plus everyone on file there.             |
| Application | The company's domain, plus the people attached to that application. |
| Resume      | Every application it is attached to.                                |

A thin result usually means a contact with no email or a company with no website — the
`notes` field says which, and `update_contact` or `update_company` fixes it.

### `get_google_connection`

*Is Gmail and Calendar connected*

Whether this person has connected their Gmail and Google Calendar, which of the two was granted, which Google address it is, and whether the connection has broken and needs reconnecting. Call this first when a mail or calendar tool fails, or before promising to look something up in their inbox. Connecting cannot be done from here — it is a consent screen at Google — so when `connected` is false, tell them to open Settings → Google in the app and press Connect, then come back. Nothing in the inbox is stored on this instance: every read is live, and disconnecting deletes the only thing held, the token.

No arguments.

### `list_correspondence`

*Mail and meetings about one record*

Every email thread and calendar event in the person's own Google account that involves one thing on the pipeline: a contact (matched on their email address), a company (its website's domain plus everyone on file there), an application (its company's domain plus the people attached to it) or a resume (every application it was sent with). This is the tool for 'what's the latest with Stripe', 'have I heard back from Jane', 'when is my interview' and 'what did the recruiter actually say' — call it before summarising where an application stands, because the pipeline's timeline only knows what was logged by hand. Pass exactly one id. Returns `mail` (threads, newest first, with subject, snippet, participants and a link) and `calendar` (past and upcoming events, with attendees, a Meet link and a link) — either is null when that half is not granted or Google refused, with the reason in `warnings`. `notes` explains a thin result, usually a contact with no email or a company with no website; fix those with update\_contact and update\_company and call again. Nothing is saved. To read a thread in full, pass its id to get\_email\_thread; to remember what you learned, log\_activity on the application or contact.

**Reaches outside this instance.**

| Argument        | Type   |                                                                                                       |
| --------------- | ------ | ----------------------------------------------------------------------------------------------------- |
| `contactId`     | string | A contact id. Matches their email address.                                                            |
| `companyId`     | string | A company id. Matches its website's domain and the addresses of its people.                           |
| `applicationId` | string | An application id. Matches the company's domain and the people attached to this application.          |
| `resumeId`      | string | A resume id. Matches every application the resume is attached to.                                     |
| `limit`         | number | How many threads to return at most. Default 20, maximum 50.                                           |
| `days`          | number | How far back to look, in days. Default 365. Calendar events up to 120 days ahead are always included. |

### `search_email`

*Search Gmail*

Search the person's Gmail with Gmail's own query syntax — `from:jane@acme.com`, `subject:offer newer_than:7d`, `"phone screen"` — or plain words. Reach for this when the question is about mail that does not map to one record: 'did any rejections come in this week', 'find the email with the take-home', 'who have I emailed about referrals'. For mail about a specific contact, company or application, list\_correspondence already builds the right query. Returns threads newest first with subject, Gmail's snippet of the latest message, everyone on the thread, when it last moved and a link that opens it in Gmail. Subjects and snippets only — pass a thread id to get\_email\_thread for the messages themselves. Read-only; nothing is saved, and this tool cannot send, archive or delete anything.

**Reaches outside this instance.**

| Argument | Type   |                                                                                                                                            |
| -------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------ |
| `query`  | string | **required** — A Gmail search. Operators like from:, to:, subject:, newer\_than:7d, has:attachment and label: all work, as do plain words. |
| `limit`  | number | How many threads at most. Default 20, maximum 50.                                                                                          |

### `get_email_thread`

*Read an email thread*

One thread in full, oldest message first: who sent each message, to whom, when, and the body as plain text (HTML mail is stripped to text; attachments are never fetched; very long messages are cut). The id comes from list\_correspondence or search\_email. This is how you find out what a recruiter actually wrote — the dates they proposed, the salary they named, the next step they described — before logging it with log\_activity or moving the application with move\_application\_stage. Quote the mail when you report it; do not paraphrase a number. Read-only, and nothing about the thread changes: it is not marked read.

**Reaches outside this instance.**

| Argument   | Type   |                                                                          |
| ---------- | ------ | ------------------------------------------------------------------------ |
| `threadId` | string | **required** — The thread id from list\_correspondence or search\_email. |

### `search_calendar`

*Search Google Calendar*

Events on the person's primary Google Calendar in a window, optionally filtered by a free-text search over title, description, location and attendee addresses. Use it for 'what interviews do I have this week', 'when did I last meet anyone from Acme' or 'am I free Thursday afternoon' — for a whole week of the pipeline's own dates alongside these meetings, list\_schedule merges both. Defaults to thirty days back and sixty ahead. Each event has its title, start and end, whether it is all-day, the attendees with their RSVP, the organizer, a Meet link when there is one, and a link to the event. Read-only; nothing here creates, accepts or declines anything.

**Reaches outside this instance.**

| Argument | Type   |                                                                                                              |
| -------- | ------ | ------------------------------------------------------------------------------------------------------------ |
| `query`  | string | Words to match against title, description, location and attendee emails. Omit for every event in the window. |
| `from`   | string | Start of the window, ISO date (YYYY-MM-DD). Default: 30 days ago.                                            |
| `to`     | string | End of the window, ISO date (YYYY-MM-DD), inclusive. Default: 60 days ahead.                                 |
| `limit`  | number | How many events at most. Default 100.                                                                        |

### `disconnect_google`

*Disconnect Gmail and Calendar*

Revoke this instance's access to the person's Gmail and Google Calendar and forget the token. Every mail and calendar tool stops working immediately and the panels in the app go back to offering a Connect button; nothing else — no contact, application or logged activity — is touched, because nothing from Google was ever stored. Confirm before calling it. Reconnecting is the same consent screen as the first time, under Settings → Google.

**Overwrites or deletes.** **Reaches outside this instance.**

No arguments.
