Connect an agent integration
connect_agent_oauthConnect external ad, analytics, and marketing accounts to a deployed agent using a sign-in link or saved token, then check sign-in status and select which accounts the agent uses.
Instructions
Connect an outside account (Google Ads, GA4, YouTube, Google Business, Merchant Center, Meta Ads, Instagram, Facebook Pages, TikTok, LinkedIn, X, HubSpot, Mailchimp, Reddit, Shopify) to a deployed agent, with a sign-in link or a saved token, as list_agent_skills shows for each service. action connect: with Wiro's own app (mode wiro) or the user's own app (mode own) it returns a sign-in link that the user must open in their own browser and approve within 15 minutes; never open it for them. With mode api_key it checks a token saved earlier with set_agent_credentials and returns the accounts it can use, with no browser. Without mode the tool picks the one that works; when a provider needs the user's own app keys or a token first, it says which to save. action status: whether the sign-in finished (wait_seconds waits for the user). action select_accounts: saves which accounts the agent uses ({id, name} from connect), and with picker runs the extra step some providers have (Meta Ads pages, Google Business locations). Connecting again replaces an existing connection and needs confirm: true. A running agent restarts when a connection or selection is saved. Remove a connection with disconnect_agent_oauth. Connect only a credential that the agent's skills use (get_my_agent lists them). Only the person who deployed the agent can connect, so the connected project must be one that person created. The agents playbook (get_playbook) has the full setup walkthrough.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | connect: wiro (Wiro's app), own (the user's own app, keys saved first) or api_key (a saved token, no browser). Omit to let the tool choose. | |
| action | No | connect (default) starts a connection, status checks it, select_accounts saves the accounts to use. | connect |
| picker | No | select_accounts: the extra step's key ("pages" for Meta Ads, "locations" for Google Business). Without selections it lists the choices. | |
| confirm | No | connect: true to replace an existing connection after the user agreed. | |
| accounts | No | select_accounts: the accounts to use, each {id, name}, as returned by connect. | |
| agent_guid | Yes | The deployed agent's guid, from list_my_agents. | |
| credential | Yes | The integration's credential key, for example "google-ads", "meta-ads", "instagram", "hubspot" or "shopify". | |
| selections | No | select_accounts with picker: what to use under each account. Accounts left out get nothing. | |
| redirect_url | No | connect: where the browser goes after sign-in. Defaults to the agent's page in the Wiro dashboard, which also handles the account choice. The only other accepted address is a local one on the user's own machine (http://localhost or http://127.0.0.1, any port). Keep the default unless the user asks. | |
| wait_seconds | No | status: how long to wait for the sign-in to finish, 0 to 600 seconds (default 0, a single check). | |
| since_connected_at | No | status: the since_connected_at value from connect's nextAction, so an older connection is not mistaken for the new one. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | ||
| state | Yes | ||
| title | Yes | ||
| action | Yes | ||
| message | Yes | ||
| accounts | No | ||
| agentGuid | Yes | ||
| childStep | No | ||
| candidates | No | ||
| credential | Yes | ||
| nextAction | No | ||
| connectedAt | No | ||
| redirectUrl | No | ||
| authorizeUrl | No | ||
| tokenExpiresAt | No | ||
| connectionModes | No | ||
| expiresInSeconds | No | ||
| ownAppRedirectUri | No |