Skip to main content

Module google_tool

Module google_tool 

Source
Expand description

The Google connectors’ tools: Calendar, Drive and Gmail, each listed only for an agent with a grant on its service (docs/specs/SPEC_GOOGLE_CONNECTORS_GMAIL_CALENDAR_DRIVE_2026_10_14.md D3, D4). srv makes the call with the account’s token; this only forwards the arguments and marks what comes back as other people’s text (D6).

Constants§

ACTIONS 🔒
The actions, as the errors list them.
MAX_STATUS_WAIT_SECS 🔒
The most a connect_status call waits for the sign-in to change (srv’s own cap).
SERVICES_WAIT 🔒
How long tools/list waits for srv to say which services are granted.

Statics§

GRANTS_CHANGED 🔒
Woken when this agent changes a grant (Google grant, ungrant), so the services it holds are read again at once and the client is told, not after the next minute’s look.

Functions§

adopt_granted 🔒
Keeps current as srv last said (fetched; None, srv said nothing, changes nothing) and says whether the services differ now, which is when the client must be told.
call 🔒
call_listed_elsewhere 🔒
Google call: a service’s tool through this one, for a client that has not listed the tool it was just granted (it ignores notifications/tools/list_changed). The arguments are the tool’s own.
connect 🔒
Google connect: srv starts the same flow as the Accounts panel’s Connect, without opening the system browser, and answers the consent URL; this opens that page in a Browser pane the agent owns, on the person’s own profile (their sign-ins are there), and says what is next.
fetch_granted 🔒
The same, but None when srv didn’t answer, so a refresh keeps what it had instead of taking the tools away for a failed look.
forward 🔒
A service tool’s call, made to srv, which checks the grant. The tool being listed is not part of it.
google_call 🔒
Google: which Google accounts are connected and who holds what (status), turning a service of an account on or off for an agent (grant, ungrant), and ending a connection (disconnect). The person only signs in and consents; this is everything else (spec D7).
granted_services 🔒
The services this agent has a grant on, for tools/list. None when srv can’t say (not reachable, an older srv): the agent then sees no Google tool.
on_another_machine 🔒
status, grant and ungrant with a host: the other machine’s srv runs them as operations (google.status, google.grant), where the Google accounts are. The agent to grant is named, as there is no “yourself” across machines. connect stays on the machine that holds the account: the sign-in is a person’s, there.
services_of 🔒
untrusted 🔒
srv’s answer for the agent: who it is about, then the result as untrusted text.