Skip to main content

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.

4 min read
View MarkdownEdit on GitHub
Shared railUsed by buy-side and sell-side agents alike; not tied to a money direction.

Providers, credentials, and shopper identity.

tool codespar_manage_connections7 actionsmoves no money

Pairs 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

actionWhat it doesMoneyNeeds
list
example below
List the accounts and identity the agent has connectedno
statusRead one provider's connection statusnoserver_id
initiateGet a dashboard deep-link where the operator connects an API-key or OAuth provider; credentials never pass through herenoserver_id
connect_startFor a login-walled store (meli, ifood): get a live-view URL where the buyer logs into their own account oncenoserver_id
connect_finishPersist the login started by connect_start, using its session_id and context_idnoserver_idsession_idcontext_id
save_profileVault the buyer's guest-checkout identity once (name, email, CPF, address), merged field by field, so codespar_shop auto-fills itnoprofile
get_profileRead the vaulted checkout identity, maskedno

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.

Call · tools/call
arguments
{
  "name": "codespar_manage_connections",
  "arguments": {
    "action": "list",
    "environment": "test"
  }
}
Result

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_id like asaas, nfe-io): list, status, initiate. initiate returns 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_start returns a live-view URL the user opens to log into their own account once (their 2FA); then connect_finish with the session_id and context_id from connect_start persists that login. For meli, that login is what codespar_shop buys 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_profile vaults the buyer's checkout identity once (name, email, CPF, full address; encrypted) so codespar_shop auto-fills it; get_profile returns 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_profile merges field by field: save the address first and add the email later; the response returns needs: "email" and profile_complete: false until an email is set.

Arguments

FieldTypeRequiredDescription
actionstringNolist | status | initiate (dashboard providers) · connect_start | connect_finish (login-walled stores) · save_profile | get_profile (vaulted shopper identity)
server_idstringFor status, initiate, connect_start, connect_finishProvider or store id (asaas, nfe-io, meli, ifood)
countrystringNoISO 3166-1 alpha-2 filter (list only)
environmentstringNolive | test. Defaults to live
return_tostringNoPath inside the dashboard to redirect to after the user finishes connecting (initiate only)
session_idstringFor connect_finishFrom connect_start
context_idstringFor connect_finishFrom connect_start; persists the buyer's login
consumer_idstringNoWhich buyer is connecting, or whose profile to save. Defaults to the session's user id
profileobjectFor save_profile{ buyer: { firstName, lastName, email, document (CPF), phone }, address: { postalCode, street, number, neighborhood, city, state, complement } }. Stored encrypted

Errors and what to do

ErrorCauseWhat to do
invalid_argsAn 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_profileNot an error: the profile has no email yet.Ask the buyer for a dedicated checkout email and save it.
A status of not connectedThe 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.

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_manage_connections | CodeSpar