PreciseDocs

MCP and A2A

The sandbox is a credentialed MCP server at https://sandbox.precise.ai/api/mcp that answers over Streamable HTTP for your company's isolated enclave (Authorization: Bearer $PRECISE_SANDBOX_KEY or the URL-scoped endpoint /api/mcp/$PRECISE_SANDBOX_KEY). The unified Access deployment serves the product tools, four embeddable cards and A2A for the thin app and headless clients.

On this page
CapabilityRuntimeStatus
Discover the sandbox MCP tools, resources and five prompts with your workspace keySandboxLive
Discover product tools and four cards on configured credentialed AccessSandboxPreview
Read the Access A2A agent card and send a JSON-RPC message to /api/a2aSandboxPreview

Connect a client

Request a private per-company workspace key (penv_...) at https://sandbox.precise.ai, then export PRECISE_SANDBOX_KEY (or paste your URL-scoped /api/mcp/<key> endpoint directly):

Shell
claude mcp add --transport http precise-sandbox https://sandbox.precise.ai/api/mcp --header "Authorization: Bearer $PRECISE_SANDBOX_KEY"
codex mcp add precise-sandbox --url "https://sandbox.precise.ai/api/mcp/$PRECISE_SANDBOX_KEY"

For Cursor, add your URL-scoped server to mcp.json:

JSON
{"mcpServers": {"precise-sandbox": {"url": "https://sandbox.precise.ai/api/mcp/<YOUR_SANDBOX_KEY>"}}}

The endpoint

POST /api/mcp answers protocol revisions 2026-07-28, 2025-11-25, 2025-06-18 and 2025-03-26 with plain JSON. Any instance answers any request, so a tools/list works with no initialize before it.

A 2025-revision client sends plain JSON-RPC with Accept: application/json, text/event-stream. A request that leaves that header out is answered with HTTP 406. Legacy initialization echoes the supported revision you requested: 2025-03-26, 2025-06-18 or 2025-11-25.

Runtime: SandboxStatus: Liveinitialize
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "initialize",
  "params": {
    "protocolVersion": "2025-11-25",
    "capabilities": {},
    "clientInfo": {
      "name": "docs-example",
      "version": "1.0"
    }
  }
}

A 2026-07-28 client states its revision on every request: the MCP-Protocol-Version and Mcp-Method headers, Mcp-Name on a tool call, and two keys under params._meta. The answer then links the run and the guide as resource_link content.

Runtime: SandboxStatus: Livetools/call · size_holdout
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "size_holdout",
    "arguments": {
      "order_id": "ORD-067"
    },
    "_meta": {
      "io.modelcontextprotocol/protocolVersion": "2026-07-28",
      "io.modelcontextprotocol/clientCapabilities": {}
    }
  }
}

The ten tools

Runtime: SandboxStatus: Livetools/list
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/list"
}
ToolWhat it answersMain inputsScope
get_guideWhat the tables, measures, methods and workflows meansection, nameWorkspace key (precise:read)
get_bookThe book, a search of its orders, or one order in fullid, query, format, holdout, campaign_id, limit, offsetWorkspace key (precise:read)
queryOne read-only SQL query or one structured joinsql or join_spec, max_rows (1 to 200), timeout_ms (100 to 120,000)Workspace key (precise:query)
run_analysisOne Gateway method or one workflowmethod or workflow, order_id, fixture, describe, list_contractsWorkspace key (precise:run)
size_holdoutThe smallest Audience Holdout that detects a lift, or what a test can detectorder_id, or baseline_rate, mde, daily_volume, max_days, max_holdout_pct, alpha, powerWorkspace key (precise:run)
get_callsThe record of scored Decisions, or one Decisioncall_id, status, order_id, campaign_id, limitWorkspace key (precise:read)
inspect_auditA verified run, reopened by its run_idrun_idWorkspace key (precise:read)
make_callRecords a Decision and its forecast range before spend movesknown, chosen, predicted_value, lower, upper, confidence_level, gateway_run_idWorkspace key (precise:record)
score_callScores a recorded Decision against its outcomecall_id, realized_value, lessonWorkspace key (precise:record)
advance_timeMoves the workspace clockhours (1 to 336)Workspace key (precise:record)

The record these tools read and write is a Decision. The hosted sandbox still serves it under its older tool names, get_calls, make_call and score_call, so the examples on this site use those names exactly.

How an answer reads

Every tool answer opens with one or two sentences. Measured: is read from the records. Said: is what Precise predicts or proposes, with its range. An answer that ran a query, a method or a workflow ends its sentence with the run and a short digest. One structuredContent object follows, shaped by the tool's outputSchema, with the full run_id and result_digest.

Read the book. On the synthetic book the answer is measured: 84 orders, $19,851,772 of media spend, 13 orders with an Audience Holdout.

Runtime: SandboxStatus: Livetools/call · get_book
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_book",
    "arguments": {}
  }
}

Query it. The answer is three rows, led by online video at $9,262,672.56 of media spend.

Runtime: SandboxStatus: Livetools/call · query
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "query",
    "arguments": {
      "sql": "SELECT format, ROUND(SUM(media_spend_usd), 2) AS media_spend_usd, SUM(impressions) AS impressions FROM gold_daily_cube GROUP BY format ORDER BY media_spend_usd DESC"
    }
  }
}

Size a test. For order ORD-067 the answer is a Said: sentence: with 48 units per arm, the order's cap, the test can detect a lift of 13.8 percentage points, and the target of 0.40 points needs 57,487 units per arm.

Runtime: SandboxStatus: Livetools/call · size_holdout
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "size_holdout",
    "arguments": {
      "order_id": "ORD-067"
    }
  }
}

Resources and prompts

ResourceHolds
precise://guideWhat the tables, measures, methods and workflows mean, under one digest
precise://catalogThe pinned Parquet catalog: every table, its columns and the catalog digest
precise://runs/{run_id}One verified run, reopened
precise://guide/methods/{family}/{method}One method: the question it answers, what it assumes, how to say its result
precise://guide/workflows/{name}One workflow with its real steps
Runtime: SandboxStatus: Liveresources/read · precise://guide
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "resources/read",
  "params": {
    "uri": "precise://guide"
  }
}

There is one prompt per workflow.

PromptStepsThe question it answers
understand-the-book20Where is spend leaking, and which signals are confounded?
find-the-next-move10Which reallocation or bid change earns the most for its risk?
design-the-test5What is the smallest Audience Holdout that can detect the lift you care about?
measure-and-learn11Did the decision land inside its predicted range once outcomes matured?
plan-adaptive-campaign-loop5How do the current setup and a changed setup compare, period by period, while outcomes mature?

Authentication failure (401 workspace_required)

Without a valid workspace key, sandbox MCP and REST calls fail closed with HTTP 401. The www-authenticate header reads Bearer realm="precise-sandbox", resource_metadata="https://sandbox.precise.ai/.well-known/oauth-protected-resource". Request a private per-company workspace key on https://sandbox.precise.ai.

JSON
{
  "jsonrpc": "2.0", "id": 8,
  "error": {
    "code": -32001,
    "data": {
      "code": "workspace_required", "tool": "make_call", "scope": "precise:record",
      "works_without_a_key": ["get_guide", "get_book", "query", "run_analysis", "size_holdout", "get_calls", "inspect_audit"],
      "resource_metadata": "https://sandbox.precise.ai/.well-known/oauth-protected-resource"
    }
  }
}

The app's MCP server

The app uses the same Access control plane as an API client. On the pinned public-test configuration, tools/list returns 34 tools with the optional ratio worker and 33 without it. resources/list includes the guide, catalog and four self-contained cards. A host can discover which card belongs to a tool from _meta.ui.resourceUri.

ToolCard URI
get_overviewui://precise/cards/figure-card
get_decisionui://precise/cards/decision-card
size_holdoutui://precise/cards/holdout-dial-card
get_proof_fileui://precise/cards/proof-verifier-card
verify_proof_fileui://precise/cards/proof-verifier-card

Send Accept: application/json, text/event-stream. The deployed public book returns JSON. Unified Access can return a JSON-RPC response as an SSE message. Decode its data: field when the media type is text/event-stream. An HTTP 200 can still contain a JSON-RPC error or result.isError:true.

A2A

At your Access origin, /.well-known/agent-card.json advertises both 1.0 (SendMessage) and 0.3 (message/send) at /api/a2a. Send a single structured part with skill and input. The eligible skills depend on the caller and deployment. The public sandbox returns 404 for that agent card.

Selected fields from the completed task follow. The full artifact also contains the measured answer, its source and the limits of the comparison.

Runtime: SandboxStatus: PreviewPOST /api/a2a
curl -sS --fail-with-body "$PRECISE_URL/api/a2a" \
  -H 'content-type: application/json' \
  -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "SendMessage",
  "params": {
    "message": {
      "role": "ROLE_USER",
      "messageId": "docs-example",
      "parts": [
        {
          "data": {
            "skill": "ask",
            "input": {
              "question": "Which deal lost to the open line?"
            }
          }
        }
      ]
    }
  }
}'

Example answerSample Book · Synthetic Data

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "task": {
      "status": {
        "state": "TASK_STATE_COMPLETED"
      },
      "artifacts": [
        {
          "name": "ask",
          "parts": [
            {
              "data": {
                "question": "Which deal lost to the open line?",
                "understood": true
              }
            }
          ]
        }
      ]
    }
  }
}

For governed buying, use the buyer and governance URLs published for your tenant. See AdCP governance and buying.

REST API quickstart · API and MCP playground · Limits and errors

↑↓ to move↵ to open

Connect an agent

Precise Sandbox speaks MCP over Streamable HTTP with a per-company workspace key (penv_...). Request a private sandbox key at sandbox.precise.ai.

https://sandbox.precise.ai/api/mcp/<YOUR_SANDBOX_KEY>

Set PRECISE_SANDBOX_KEY to your per-company workspace key (penv_...), then run once in a terminal.

claude mcp add --transport http precise-sandbox https://sandbox.precise.ai/api/mcp --header "Authorization: Bearer $PRECISE_SANDBOX_KEY"