Docs

Connect an agent to Riptide

Connect your agent to Riptide at POST /mcp using MCP over streamable HTTP, protocol version 2025-06-18. Tools follow your tenant permissions and enabled features. Registered agents also sign requests and follow configured action limits and approval requirements.

Riptide Console model registry with baseline and shadow bid models
AI agents ยท Models

Start with a working client

Before implementing tool calls, use the discovery client to see the schemas available to your credential. It opens a session and exports the tool catalog without executing tools. Download integration recipes, run its local tests, then supply your gateway URL, tenant ID and API key. The gateway URL is separate from the console and serving hosts. A credential must have the roles for the tools it calls; console-backed tools also require the deployment's console connection to be configured.

1. Authenticate and initialize

Send Authorization: Bearer <api-key> or X-Riptide-Api-Key on every request. Use Content-Type: application/json and Accept: application/json, text/event-stream. Send this body to POST https://<gateway-host>/mcp:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "initialize",
  "params": {
    "protocolVersion": "2025-06-18",
    "capabilities": {},
    "clientInfo": {
      "name": "my-riptide-client",
      "version": "1.0.0"
    }
  }
}

Save the returned Mcp-Session-Id header. Send it and MCP-Protocol-Version: 2025-06-18 on subsequent requests under the same credential. Send {"jsonrpc":"2.0","method":"notifications/initialized"} next; a notification receives HTTP 202. Sessions expire after 24 hours idle; an unknown or expired session returns 404, so initialize again. DELETE /mcp with the session header closes the session.

2. Discover the schemas

{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}

Follow result.nextCursor by passing params.cursor until it is absent. Each visible tool carries inputSchema, annotations and metadata for its required role, entitlement, autonomy band, and human approval requirement. Build calls from this catalog; available features depend on the deployment and your credentials.

3. Make a read-only call

Replace the tenant UUID with your own. This call runs under the API-key actor and requires supply.read. Registered-agent calls add the identity and signature described below.

{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": {
    "name": "riptide.supply.list_publishers",
    "arguments": {
      "tenant_id": "018f0000-0000-7000-8000-000000000001",
      "limit": 10
    }
  }
}

Read the JSON-RPC error field even when HTTP is 200. Successful calls return result.structuredContent and a text rendering in result.content. Mutating tools require arguments.idempotency_key and the fields their schema declares, including a reason where required. Preserve the idempotency key for retries of the same intended change. A response containing awaiting_approval means the change is waiting for a person's approval.

Registered agents: identity and signatures

Register with createAgentIdentity, then register a public key using rotateAgentIdentityKey through the Admin API. The identity's autonomy band, default write permissions, and caps define its operating limits. Keep the private key in your agent's secret store. Put the registered identity ID in params._meta["riptide/agent_id"] for each tool call and add:

X-Riptide-Agent-Signature: kid=<key-id>,ts=<unix-seconds>,alg=ed25519,sig=<standard-base64-signature>

Sign the following UTF-8 bytes, separated by newline characters with no trailing newline. Hash the exact JSON-RPC body bytes that will be sent; do not serialize them again afterward. The canonical method for an MCP call is MCP, even though HTTP uses POST:

riptide-agent-v1
<unix-seconds>
MCP
/mcp
<lowercase-hex-sha256-of-exact-json-rpc-body>

Ed25519 signs these bytes directly. ES256 signs their SHA-256 digest using ASN.1 DER ECDSA encoding and sets alg=es256. The gateway accepts timestamps within five minutes, rejects replayed signatures and rejects revoked or missing keys. A retried signed call needs a fresh signed message while retaining its mutation idempotency key. The API key alone cannot authenticate a registered agent.

Approval tasks and audit

A mutation above the identity's band can return structuredContent.status: awaiting_approval with an approval task and a request for input. Show it to the authorized reviewer; use the discovered riptide.agent.approve_task or riptide.agent.reject_task tool as that actor, then read the task result. Do not report completion until it is completed. Hard caps, kill switches, separation-of-duties rules and explicit scope denials cannot be bypassed by retrying. Mutations and governance refusals expose audit IDs for review.

Other transports and MCP methods

MCP method familyPurpose
tools/list, tools/callDiscover tool schemas and permission requirements, then call an authorized operation.
resources/list, resources/templates/list, resources/readRead the tool catalog, tenant tasks, and agent limits.
prompts/list, prompts/getRetrieve prompts for media buying, delivery diagnostics, and agent administration.
tasks/list, tasks/get, tasks/result, tasks/cancelInspect durable approval tasks and their eventual result.

REST clients may use GET /v1/tools and POST /v1/tools/invoke with {"tool":"...","tenant_id":"...","input":{}}. A registered identity goes in the top-level agent_id; sign the exact REST body with canonical method POST and path /v1/tools/invoke. Both transports apply the same permissions and approval rules. A customer checkout can run agentgw stdio with RIPTIDE_AGENTGW_STDIO_API_KEY; stdio has no signature header and refuses registered-agent calls, so use HTTP for signed identities.

GET /mcp returns 405: this gateway returns JSON responses and durable tasks, without a server-initiated event stream. OAuth-capable clients can discover /.well-known/oauth-protected-resource when the operator configured an issuer and audience. Unconfigured tools return typed not_wired or dependency errors. Browser sign-in and live-report streams use separate endpoints. See standards and limits for supported AdCP, UCP, and A2A workflows.

Build your first Riptide agent

Run the discovery client to inspect the schemas available to your credential. Use the tool examples to choose the operations your agent needs before adding calls that change configuration.