Skip to main content
An agent can use AIsa Connect in two ways: Both use the same API, end users, connections and pricing.

MCP

Connect your client

Point the client at https://mcp.aisa.one/mcp. Authorization is OAuth: the client opens a browser and you click Allow once. Clients without a browser send Authorization: Bearer YOUR_AISA_API_KEY instead. Per-client setup is in Connect via MCP.
A personal MCP or CLI sign-in acts as your AIsa account, so the agent sees the same connections as your API keys. Runs need a positive balance, as with an API key. A sign-in for an organization runs actions only with connector:write; see Scopes.

Connect operations over MCP

The MCP server reaches every endpoint through a few meta tools: search, list_categories, get_details and batch_quote are free, and batch_use runs the calls. AIsa Connect appears there as these operations, with the same IDs as the API reference: Take the exact tool names and arguments from search or get_details; do not invent them.

How the agent finds an app’s actions

App actions such as gmail.search_threads or google_search_console.query_search_analytics are not separate MCP tools. search finds the Connect operations above, not the actions inside each app. The reliable path is:
1

List the app's actions

Call List the actions of an app with the app key (gmail, google_search_console, shopify, …) and, optionally, q to filter by key, name or description. If the app key is unknown, call List apps with q first.
2

Read the action's schema

Each action in the list carries its inputSchema and operationType. Call Get an action for one action when needed.
3

Run it

Call Run an action with actionKey, the end user’s externalUserId and an input that matches the schema. Price it with batch_quote first, as for any paid call.
A prompt that works well:

Which end user ID to use

  • Your own accounts. Connect them in the Console. The Console connects them as end user console-user-<your user id>; copy it from the app’s page and give it to the agent.
  • Your customers’ accounts. Pass the same externalUserId your backend uses for them.
  • Connecting from the agent. The agent can call Start a hosted connect and show you the connectUrl. Open the complete link in a browser and authorize, then let the agent poll Get a connect session.

AIsa CLI

The AIsa CLI reaches the same operations: aisa search, then aisa schema when needed, aisa quote, and aisa call with the operation IDs above. Sign in with aisa login, or set AISA_API_KEY for CI.

Function calling

When you build the agent yourself, turn the actions it needs into tools. Each action already has a JSON Schema for its input, so a tool definition is a direct mapping: Then, when the model calls a tool, your code calls POST /actions/run with the action key, your end user ID and the model’s arguments as input, and returns output (or the error) to the model. The examples below give the model Gmail’s read actions that match thread, and use AIsa as the model provider, so one AIsa key covers both the model and AIsa Connect. Any model provider works the same way.

Shared helpers (Python)

Model SDKs

Vercel AI SDK (TypeScript)

Generic tools for a large catalog

Gmail alone has dozens of actions, and the catalog has well over a thousand apps. Instead of one tool per action, you can give the model three generic tools, the same pattern the MCP server uses: The model then discovers actions at run time. Validation still protects you: a run whose input does not match the schema returns 422 validation_failed with the problems, which the model can fix.

Guardrails

  • Set the end user in your code. Take externalUserId from your signed-in user, never from the model’s arguments, so a prompt cannot make the agent act in another user’s account.
  • Start with read actions. Expose write and destructive actions only when you need them, and ask the user to approve each one before your code runs it.
  • Retry writes safely. Send an Idempotency-Key, such as the tool call ID, so a repeated call returns the first answer instead of running twice. After app_error or outcome_unknown, check in the app before retrying.
  • Handle reconnects. On 409 reconnect_required or connection_required, stop and ask the user to connect the app, rather than letting the model retry.
  • Keep outputs small. Some actions return large payloads. Trim output before you return it to the model if your context window is tight.