pub(crate) const IDENTITY_TOOL: &str = r#"{
"name": "Identity",
"description": "Your presets and linked provider accounts. Every call takes an action. presets: the presets available to you, summary fields only (a preset is a provider-agnostic bundle of instructions, context files and skills). preset: one preset in full, by id or name; with neither, your own bound preset. accounts: your own linked identity accounts: account_id, provider, name, kind, status, masked_tail and updated_at; with scope machine, every signed-in account on this machine instead: stable_id (the same on every machine for one provider account), account_id, provider, email, label, sign_in, quota (ok, limited or signed_out, with resets_at_ms when a limit lifts), usage (how much of each usage window is used, from the provider's own report with every request: status reported, not_yet or not_reported, and per window, five_hour or seven_day, used_percent, resets_at_ms and age_ms, the reading's age; only Claude reports, and the leaders of an account's agents get one [AgentMux] note when a window passes 75% and again at 90%), never_failover (true when the operator marked it so no agent is moved onto it by itself) and the agents on it. sign_in is read from the login's credentials file when you ask, not checked with the provider: valid means a credential is there (a lapsed access token is renewed by the CLI, and the file cannot say whether that will work), needs_reauth that the file holds none. A login copied to another machine or slot shares one refresh token, and refreshing one copy signs the others out: keep one copy of each login per machine. Secrets are never returned, only masked tails. validate: live-probe one of your accounts (account_id, from accounts) against its provider with the stored key, to confirm it still works; you never supply a secret. Returns valid, status, masked_tail and error. switch: move an agent (you, or another with agent) to another signed-in account of its provider: account is its stable_id or account_id, the label the pane shows (`email ·2` when several share it), an email when exactly one account of it has quota, or `any with quota` (another account of its provider that can run now; a refusal lists them all). agent `all limited` moves every agent that has a pane out of quota. when is after_turn (default: it moves when the agent is not in a turn, so a working agent finishes first) or now (restarts it, ending the turn). Returns status switched, queued or unchanged. A refusal lists the accounts it could use. An agent that hits its usage limit is also moved by AgentMux itself, after its turn, to a signed-in account of its provider with quota (never one that is signed out or marked never_failover), with a one-line note to the agent and its lead; the setting agent:accountfailover turns that off. check_limits: look again, now, at the agents marked out of quota (all of them, or those on account), for when the plan was raised or the quota refilled before the provider reset, which nothing else notices. Each gets a small turn, started two seconds apart on one account; one that works clears the limit, wakes what was held for it and clears the account other panes. Returns checked (agent names) and failed (agent, error); a note says when no agent was out of quota. It sends nothing in anyone name. signin (needs host): sign in an account on another machine, so an agent there can be moved onto it. The first call starts the provider's login there and returns state waiting_for_person and a url (and, for codex, a device_code): show the url, and the code if there is one, to the person in your reply, where they are reading (it also appears as a notice with an Open button on the machine they have focused), and they authorize in their browser; the credentials stay on that machine and never come to you. Then call signin again with the session to wait until it is signed_in (account_id and email), or failed; add code if the person was shown one. The other machine must trust your install. With host, accounts and switch run on another machine (it has to have approved your install: a peer it only first-saw is refused, since the listing has account emails). aws_grants: the AWS grants this machine shares with its container agents, from its grants file: for each grant name, tier (read or write), the agents it names, whether it is switched off, state (honoured, held or refused), when it was added and by which recorded change (added_ms, added_change), its latest change, and who allowed it and why; with the latest changes to the file, newest first. A grant that is new, or wider than what was last allowed (a write tier, more agents, a different recipe, switched back on, no reason needed, longer sessions, a higher hourly cap), is held: the broker refuses it (GRANT_HELD) until it is allowed. A grant that is removed or narrower is in force at once. The first time the file is read it is recorded as the baseline. Every change is a row in the Audit view. aws_grant: answer a held grant: grant, change (from aws_grants), decision allow or remove, and reason (what the grant is for and why it may be used; recorded under your name). A native agent only: a container agent can't answer for the grants it may use. Allow puts it in force at once; remove keeps it refused until the file changes again. Neither edits the grants file.",
"inputSchema": {
"type": "object",
"properties": {
"action": { "type": "string", "enum": ["presets", "preset", "accounts", "validate", "switch", "check_limits", "signin", "aws_grants", "aws_grant"], "description": "What to do" },
"id": { "type": "string", "description": "preset: the preset's id" },
"name": { "type": "string", "description": "preset: the preset's name" },
"account_id": { "type": "string", "description": "validate: one of your accounts, from accounts" },
"scope": { "type": "string", "enum": ["mine", "machine"], "description": "accounts: mine (default) or machine: every signed-in account here, with quota" },
"account": { "type": "string", "description": "switch: the account to move to: stable_id, account_id, label, email, or any with quota. check_limits: only the agents on this account (id, label or email); every agent out of quota when absent" },
"agent": { "type": "string", "description": "switch: the agent to move, or all limited; yourself when absent" },
"when": { "type": "string", "enum": ["after_turn", "now"], "description": "switch: after_turn (default) or now" },
"host": { "type": "string", "description": "accounts, switch: another machine, by the name Agents list shows, to run it there instead of here (accounts lists that machine's accounts; switch needs agent, which is an agent on that machine). Named on each call, never remembered. A switch there needs that machine to trust your install (needs_certificate otherwise). Absent means this machine." },
"provider": { "type": "string", "enum": ["claude", "codex"], "description": "signin: the provider; claude (default) or codex (the person enters a one-time code, returned as device_code, on the page)" },
"session": { "type": "string", "description": "signin: the session a first call returned. With it, signin waits for that sign-in to end" },
"code": { "type": "string", "description": "signin with a session: the code the person was shown, when the browser couldn't finish on its own" },
"reason": { "type": "string", "description": "accounts, switch, signin with a host: one line, why; the other machine records it. aws_grant: why the grant may be used, or why not (needed; recorded)" },
"grant": { "type": "string", "description": "aws_grant: the grant's name, from aws_grants" },
"change": { "type": "string", "description": "aws_grant: the grant's change, as aws_grants listed it; an answer to a grant that has changed since is refused" },
"decision": { "type": "string", "enum": ["allow", "remove"], "description": "aws_grant: allow the grant, or remove it (it stays refused until the grants file changes again)" }
},
"required": ["action"]
}
}"#;Expand description
Identity: an agent’s presets and linked provider accounts.