Dashboard|

Connector Tools

Import any OpenAPI spec onto a connection and expose its operations as hosted agent tools — no wrapper code.

Import a spec

Every connection can carry imported operations. Point Cencori at an OpenAPI 3.x JSON document (inline or via a https URL) and it parses each path+method into a connector operation — stored on the connection's metadata, capped at 60:

curl -X POST https://cencori.com/v1/connections/con_9f8e7d6c5b4a1234/import \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"spec_url": "https://api.acme.example/openapi.json"}'
{
  "imported": 14,
  "base_url": "https://api.acme.example/v1",
  "title": "Acme CRM",
  "operations": ["get_order", "create_order", "delete_order"]
}

Operation IDs come from the spec's operationId (or are synthesized from the path). The https servers[0] URL becomes the connection's base_url. Re-run the import anytime to refresh.

Expose them to agents

List the connection in a version manifest's connection_tools (optionally filtered to specific operations):

{
  "connection_tools": [
    { "connection_id": "con_9f8e7d6c5b4a1234", "operations": ["get_order"] }
  ]
}

Agents see hosted tools named conn__<connection>__<operation> — the same pattern as mcp__ MCP tools.

Execution and safety

  • GET/HEAD operations are classified as reads: the run loop executes them directly after the egress policy allows the base host.
  • Other methods are writes; DELETE is destructive. They create approval actions — same risk/expiry model as any other action, approved via POST /v1/actions/{actionId}/approve, which dispatches against the connection's live credential.
  • Arguments map to path parameters (required), query, headers, and body — path params are URL-encoded; the secret is injected as Authorization: Bearer and never reaches the model.
  • Sessions do not execute connector tools server-side: a turn pauses with the tool call and your client resumes with the result, exactly like other function tools.

Connect an account with OAuth

A connection to an OAuth connector (Gmail, Slack, Notion, and the rest of GET /v1/connectors) starts as pending and becomes active once the account owner consents.

For Gmail you can call authorize with no client_id: the consent screen is Cencori's, and it asks for permission to send mail (gmail.send) and nothing else. Asking for any other Google scope that way returns 400 scope_not_available.

To ask for more, or to show your own name on the consent screen, pass the client_id and client_secret of your own OAuth app, as below. A connector Cencori has no app for returns 400 oauth_client_not_configured without them.

# 1. Create the connection
curl -X POST https://cencori.com/v1/connections \
  -H "Authorization: Bearer sk_live_..." -H "Content-Type: application/json" \
  -d '{"connector": "gmail", "tenant_id": "ten_..."}'
 
# 2. Start consent
curl -X POST https://cencori.com/v1/connections/con_9f8e7d6c5b4a1234/authorize \
  -H "Authorization: Bearer sk_live_..." -H "Content-Type: application/json" \
  -d '{
    "client_id": "1234.apps.googleusercontent.com",
    "client_secret": "GOCSPX-...",
    "scopes": ["https://www.googleapis.com/auth/gmail.send", "https://www.googleapis.com/auth/gmail.readonly"],
    "return_url": "https://app.acme.example/settings/integrations"
  }'
{
  "authorize_url": "https://accounts.google.com/o/oauth2/v2/auth?...",
  "state": "…",
  "redirect_uri": "https://cencori.com/api/v1/connections/oauth/callback",
  "scopes": ["https://www.googleapis.com/auth/gmail.send", "https://www.googleapis.com/auth/gmail.readonly"],
  "expires_in": 900
}

Register the redirect_uri from the response on your OAuth app (in Google Cloud: Authorized redirect URIs), then send the person to authorize_url. The state is valid for 15 minutes.

There are two ways to finish. Pick one.

You passWhat happens after consent
Cencori receives the code (simplest)return_urlThe provider redirects to Cencori, which saves the connection and sends the browser to return_url?status=connected&connection_id=con_.... On failure, status=error&error=<code>.
You receive the coderedirect_uri (your own URL, registered on your OAuth app)The provider redirects to you with code and state. Your server hands them back with POST /v1/connections/{id}/exchange.
curl -X POST https://cencori.com/v1/connections/con_9f8e7d6c5b4a1234/exchange \
  -H "Authorization: Bearer sk_live_..." -H "Content-Type: application/json" \
  -d '{"code": "4/0Ab...", "state": "…"}'
{ "connected": true, "connection_id": "con_9f8e7d6c5b4a1234", "connector": "gmail", "status": "active", "scopes": ["…"] }

Either way a connection.active webhook fires. return_url is a convenience for the browser; treat the webhook or GET /v1/connections/{id} as the source of truth, since anyone can open a URL with status=connected on it.

Scopes. scopes at authorize replaces the connector's defaults. Gmail defaults to gmail.send only, so list every scope you need, gmail.send included. The scopes the provider actually granted are stored on the connection. To change them later, call authorize again.

Your OAuth app stays with the connection. The client id and (encrypted) secret are saved on the connection, so token refreshes keep working without sending them again.

Gmail tools. The built-in Gmail tool sends mail. To let an agent read mail, request a read scope and import the Gmail operations you want as connector operations (above) with https://gmail.googleapis.com as the server.

Enrichment

  • Param enrichment — the connector catalog carries curated param_overrides (per-operation descriptions, enums, required hints, dropped params) merged into parsed operations at import time. Additive metadata only, so a stale override can at worst confuse a model, never alter runtime behavior. Override keys may be exact operation names or globs (*_search) to survive vendor version churn — the hubspot catalog already ships curated entries (search DSL, merge, GDPR delete, list paging) keyed that way.