Skip to main content

GOOGLE_TOOL

Constant GOOGLE_TOOL 

Source
pub(crate) const GOOGLE_TOOL: &str = r#"{
  "name": "Google",
  "description": "The Google accounts the person has connected to AgentMux, and who may use them. The person only signs in (a password, a code) and consents; everything else is yours to do, starting the connection included. Every call takes an action. status: each connected account, what it can be used for (connected_for: none, read or write, from the consent it was given), your own level on each of Calendar, Drive and Gmail (yours: off, read or write) and which agents hold each. grant: turn a service of an account on for an agent (default yourself), at level read (default) or write; write adds drafts, labels and sending, and every send still waits for the person's approval in the AgentMux window. connect: connect a Google account (services: calendar, drive and/or gmail, at level read (default) or write; login_hint: the email to start the sign-in on; account: a connected account to add services to or to reconnect, whose current services stay on). It opens Google's consent page in a Browser pane you own, on the person's own browser profile, and answers the pane id and a session. Drive the page yourself with the Browser tool: pick the account, on the unverified-app screen choose Advanced and then Continue, and tick every box the consent screen shows; stop only at a password, a code or an administrator's block, hand the pane to the person (Browser handoff) and say what to do. connect_status (session, wait_seconds up to 25): waiting, connected (the account and what each service can be used for) or failed with the reason. cancel (session): end a connect that waits. One connect at a time per agent; the token never reaches you. ungrant: turn it off. disconnect (account): end the connection to an account for everyone: Google's access is revoked first, then the saved sign-in, every agent's grants on it and its log go; the person's window shows a notice, and getting it back takes the person signing in again, so do it only when asked or when the account must go. You may hold several accounts: once you hold a service on an account, the Calendar, Drive or Gmail tool is added to your tools right after the grant (AgentMux tells your client the list changed; if your client does not list it, use call, or restart this agent) and takes account (the email) to say which. call (tool: Calendar, Drive or Gmail; arguments: what that tool takes, action included): use a granted service's tool through this one, for a client that has not listed it; srv checks the grant as it does for the tool itself. With host (another machine's name from Agents list), status, grant and ungrant run on that machine, where its Google accounts are; grant then names agent, an agent there. connect has no host form: the person signs in at the machine that holds the account. Every grant is recorded under the agent that made it, in the account's log the person reads. Grant only what the work needs: mail you read goes to the model provider you run on.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "action":  { "type": "string", "enum": ["status", "connect", "connect_status", "cancel", "grant", "ungrant", "disconnect", "call"], "description": "What to do" },
      "account": { "type": "string", "description": "grant, ungrant, connect, disconnect: the Google account's email, from status" },
      "service": { "type": "string", "enum": ["calendar", "drive", "gmail"], "description": "grant, ungrant: which service" },
      "level":   { "type": "string", "enum": ["read", "write"], "description": "grant, connect: read (default) or write" },
      "services": { "type": "array", "items": { "type": "string", "enum": ["calendar", "drive", "gmail"] }, "description": "connect: the services to turn on (at least one)" },
      "login_hint": { "type": "string", "description": "connect: the email the sign-in starts on" },
      "session": { "type": "string", "description": "connect_status, cancel: the session connect answered" },
      "wait_seconds": { "type": "integer", "description": "connect_status: wait up to this many seconds (at most 25) for the sign-in to change" },
      "agent":   { "type": "string", "description": "grant, ungrant: the agent's name or id (default you)" },
      "host":    { "type": "string", "description": "status, grant, ungrant: another machine's name (from Agents list), to read or set Google there; grant then needs agent, the agent on that machine. connect stays on the machine that holds the account" },
      "reason":  { "type": "string", "description": "with host: why, shown on that machine" },
      "tool":    { "type": "string", "enum": ["Calendar", "Drive", "Gmail"], "description": "call: the granted service's tool to use" },
      "arguments": { "type": "object", "description": "call: that tool's arguments (its action, account and the rest)" }
    },
    "required": ["action"]
  }
}"#;