codespar_manage_connections
List, inspect or connect the accounts and identity the agent needs. Dashboard connect deep-links for API-key and OAuth providers, a one-time login for login-walled stores, and the buyer's vaulted checkout identity for guest-checkout stores.
Providers, credentials, and shopper identity.
codespar_manage_connections7 actionsmoves no moneyPairs with codespar_discover: discover finds the right tool, this one tells you whether it is reachable for this user and unblocks it if not. Credentials never pass through here; they travel via the dashboard or the OAuth callback.
Actions
action | What it does | Money | Needs |
|---|---|---|---|
listexample below | List the accounts and identity the agent has connected | no | — |
status | Read one provider's connection status | no | server_id |
initiate | Get a dashboard deep-link where the operator connects an API-key or OAuth provider; credentials never pass through here | no | server_id |
connect_start | For a login-walled store (meli, ifood): get a live-view URL where the buyer logs into their own account once | no | server_id |
connect_finish | Persist the login started by connect_start, using its session_id and context_id | no | server_idsession_idcontext_id |
save_profile | Vault the buyer's guest-checkout identity once (name, email, CPF, address), merged field by field, so codespar_shop auto-fills it | no | profile |
get_profile | Read the vaulted checkout identity, masked | no | — |
Unknown action: refused with `invalid_args`; nothing is connected or saved. Measured 2026-09-09.
Names come from the published tool document (/v1/meta-tools.json, the same list the MCP server answers to tools/list); the one-line summaries and the money class are kept in the docs repository and checked against it on every build.
Example
action: "list": what this session has connected.
{
"name": "codespar_manage_connections",
"arguments": {
"action": "list",
"environment": "test"
}
}Result shape: see runtime. The tool document names result fields only for save_profile (needs: "email" and profile_complete: false until an email is set) and says initiate surfaces a dashboard connect deep-link and connect_start a live-view URL. The published document is /v1/meta-tools.json.
When to use
- API-key and OAuth providers (
server_idlikeasaas,nfe-io):list,status,initiate.initiatereturns a deep-link into the dashboard where the operator completes the connection; render it, and the connection is available to subsequent calls once they finish. - Login-walled stores with no buyer API (
meli,ifood):connect_startreturns a live-view URL the user opens to log into their own account once (their 2FA); thenconnect_finishwith thesession_idandcontext_idfromconnect_startpersists that login. Formeli, that login is whatcodespar_shopbuys with. iFood checkout is not supported yet: connecting an iFood login only stores the session for a future capability, so tell the user that before asking them to log in. - Guest-checkout stores (VTEX: Cobasi, Animale, Lojas Pompeia):
save_profilevaults the buyer's checkout identity once (name, email, CPF, full address; encrypted) socodespar_shopauto-fills it;get_profilereturns it masked. Always ask the buyer which email to use at checkout, do not infer it: it is where the order confirmation goes, and an email already registered at the store forces a login wall the agent cannot pass, so use a dedicated checkout email not registered there.save_profilemerges field by field: save the address first and add the email later; the response returnsneeds: "email"andprofile_complete: falseuntil an email is set.
Arguments
| Field | Type | Required | Description |
|---|---|---|---|
action | string | No | list | status | initiate (dashboard providers) · connect_start | connect_finish (login-walled stores) · save_profile | get_profile (vaulted shopper identity) |
server_id | string | For status, initiate, connect_start, connect_finish | Provider or store id (asaas, nfe-io, meli, ifood) |
country | string | No | ISO 3166-1 alpha-2 filter (list only) |
environment | string | No | live | test. Defaults to live |
return_to | string | No | Path inside the dashboard to redirect to after the user finishes connecting (initiate only) |
session_id | string | For connect_finish | From connect_start |
context_id | string | For connect_finish | From connect_start; persists the buyer's login |
consumer_id | string | No | Which buyer is connecting, or whose profile to save. Defaults to the session's user id |
profile | object | For save_profile | { buyer: { firstName, lastName, email, document (CPF), phone }, address: { postalCode, street, number, neighborhood, city, state, complement } }. Stored encrypted |
Errors and what to do
| Error | Cause | What to do |
|---|---|---|
invalid_args | An unknown action (the message lists the accepted values), or a status / initiate / connect_* without server_id. Nothing is connected or saved. | Fix the call against the Arguments table. |
needs: "email", profile_complete: false on save_profile | Not an error: the profile has no email yet. | Ask the buyer for a dedicated checkout email and save it. |
A status of not connected | The provider is not connected for this session. | initiate and hand the deep-link to the operator. |
Money and mandate
Nothing moves. This tool reads and writes connections and the buyer's vaulted identity; the tools that then use those connections have their own gates. The identity vault is per consumer and encrypted, and get_profile returns it masked. What a saved profile changes is convenience: later purchases do not re-ask for CEP, email or CPF.
Related
codespar_discover: the discover → connect → call loopcodespar_shop: the buyer whose identity and logins this tool holds- Shopper identity: what the vault stores and the email rule
- Authentication: how connections are scoped and persisted
- Connect links: the dashboard deep-links
initiatereturns
Notes
The discover → connect → call loop. Find the tool with codespar_discover; if the top match is not connected, initiate it (or connect_start for a store) and surface the URL to the user; otherwise call the tool. session.connectionWizard(serverId) is the typed wrapper for the most common case (SDK reference).
Operator setup. None for this tool itself: it queries the CodeSpar backend's connected accounts for the current session. The connect flows it returns point at provider-specific setup that does require the operator.
Result shapes (SDK), as previously documented. list: { connections: Array<{ server_id, connection_id, status: "connected" | "expired" | "error", connected_at }> }; status: { server_id, status: "connected" | "needs_setup" | "expired" | "error", connection_id?, expires_at? }; initiate: { server_id, status: "needs_setup" | "connected", wizard_url?, connection_id? }, where wizard_url deep-links into /dashboard/auth-configs with the server preselected. This revision did not re-verify those lists against the runtime.
From the SDK. session.execute("codespar_manage_connections", arguments) takes the same arguments as the MCP call; the selector is action (an earlier version of this page wrote operation, which the schema does not declare).
codespar_discover
Find the right tool for a free-form use case. Returns the recommended catalog tool with its connection status, pitfalls, plan and related tools, plus any native meta-tool that covers the same job.
MCP Generator
Automatically generate MCP server code from your existing API endpoints using CodeSpar's scanner and generator.