PreciseDocs

API and MCP playground

Pick any tool the sandbox serves, or write a query, and run it against the live sandbox from this page. Each answer shows its run id, its result digest and its rows, with code you can copy.

CapabilityRuntimeStatus
Query the sample book and run all seven read-only tools with your workspace keySandboxLive
Record Decisions and advance workspace time inside your isolated company enclaveSandboxLive

The playground needs JavaScript. Every example below also runs from a terminal.

What you can run

The sandbox serves ten MCP tools inside your company's isolated enclave. Every company receives a private workspace key (penv_...) requested on https://sandbox.precise.ai (sign in on the sandbox home page or paste your key in the Workspace key drawer below). Seven tools run read-only queries and methods on the sample book; three write Decisions and advance time inside your own enclave.

ToolWhat it answersScope
get_guideThe guide to the sample book: its tables, measures, verbs, workflows and the two kinds of holdoutWorkspace key (precise:read)
get_bookThe book itself: its size, one order or campaign in full, and the record of scored DecisionsWorkspace key (precise:read)
queryOne read-only SQL query, or one structured join, over the pinned Parquet catalogWorkspace key (precise:query)
run_analysisOne Gateway method or workflow, on the book or on the method's own reference input. Each answer says whichWorkspace key (precise:run)
size_holdoutThe smallest held-back share and the shortest duration that can detect a liftWorkspace key (precise:run)
get_callsThe record of scored Decisions, or one Decision's five fieldsWorkspace key (precise:read)
inspect_auditA verified run reopened by its run_id: its output, its digest and what rests on itWorkspace key (precise:read)
make_callRecords a Decision with its expected impact and rangeWorkspace key (precise:record)
score_callScores an open Decision once its outcome is inWorkspace key (precise:record)
advance_timeMakes time pass in a workspace, so delivery and outcomes arriveWorkspace key (precise:record)

Any call without a valid workspace key answers HTTP 401 with the code workspace_required. That answer is shown here like any other, so you can see its exact fail-closed shape.

What an answer carries

Every run on the Gateway returns two identifiers:

  • run_id names the run. Pass it to inspect_audit to reopen the run. The playground fills it in for you after your first run.
  • result_digest is a SHA-256 digest of the run's record. The same request text returns the same digest for the life of one Gateway process. Compare digests within one session, and compare rows across sessions.

A tool answer also starts with a plain sentence. Measured: states what the data shows. Said: states what Precise concludes from it or expects.

A query returns at most 200 rows. The limits and errors page has the limits and the error codes.

Tool examples

These are the examples in the playground's menu. Each is the arguments object of a tools/call message.

The guide's two kinds of holdout

JSON
{"section": "holdouts"}

The book at a glance

JSON
{}

Five orders that carry a holdout

JSON
{"holdout": true, "limit": 5}

One order in full

JSON
{"id": "ORD-012"}

Spend and impressions by format

JSON
{"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"}

List every method and workflow

JSON
{"list_contracts": true}

Read one method's contract

JSON
{"describe": "power/holdout"}

Check that a holdout ran clean

JSON
{"method": "comparison/holdout-integrity", "order_id": "ORD-012"}

Split credit across four parts

JSON
{"method": "contribution/shapley"}

Width of the next forecast range

JSON
{"method": "calibration/split-conformal-band"}

Size a holdout the traffic can support

JSON
{"order_id": "ORD-012"}

Size a holdout the traffic cannot support

JSON
{"order_id": "ORD-067"}

The record of scored Decisions

JSON
{"limit": 5}

Sample queries

One read-only SELECT per run. The ten tables are orders, line_items, deals, segments, tests, invoices, gold_daily_cube, outcomes, wins and bid_sample. The playground lists each table's columns.

Spend and impressions by format

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

Each deal against the open auction on the same seller

SQL
WITH deal AS (
  SELECT deal_id, seller_id, format, SUM(impressions) AS impressions, SUM(media_spend_usd) AS media_usd, SUM(allocated_segment_fees_usd) AS data_fees_usd
  FROM gold_daily_cube WHERE deal_id <> 'DEAL-OPEN-000' GROUP BY deal_id, seller_id, format
), open_line AS (
  SELECT seller_id, format, SUM(impressions) AS impressions, SUM(media_spend_usd) AS media_usd, SUM(allocated_segment_fees_usd) AS data_fees_usd
  FROM gold_daily_cube WHERE deal_id = 'DEAL-OPEN-000' GROUP BY seller_id, format
)
SELECT d.deal_id, d.seller_id, d.format, d.impressions,
  ROUND(1000.0 * (d.media_usd + d.data_fees_usd) / d.impressions, 4) AS all_in_cpm,
  ROUND(1000.0 * (o.media_usd + o.data_fees_usd) / o.impressions, 4) AS open_all_in_cpm,
  ROUND(d.media_usd + d.data_fees_usd - d.impressions * (o.media_usd + o.data_fees_usd) / o.impressions, 2) AS paid_above_open_usd
FROM deal d LEFT JOIN open_line o ON o.seller_id = d.seller_id AND o.format = d.format
ORDER BY d.deal_id

Data fees by segment vendor

SQL
SELECT l.segment_vendor,
       ROUND(SUM(g.allocated_segment_fees_usd), 2) AS data_fees_usd,
       ROUND(SUM(g.avoidable_segment_fees_usd), 2) AS avoidable_usd
FROM gold_daily_cube g
JOIN line_items l ON l.line_item_id = g.line_item_id
GROUP BY l.segment_vendor
ORDER BY data_fees_usd DESC

The planned tests

SQL
SELECT test_id, order_id, assignment_unit, split_method, allocation_treatment, planned_lift_pp, enrolled_cap_per_arm
FROM tests
ORDER BY order_id
LIMIT 10

One holdout, arm by arm

SQL
SELECT holdout_arm, SUM(eligible_units) AS eligible_units, SUM(purchases) AS purchases
FROM outcomes
WHERE order_id = 'ORD-012'
GROUP BY holdout_arm
ORDER BY holdout_arm

Wins by bid tier

SQL
SELECT bid_bucket, COUNT(*) AS bids, SUM(CASE WHEN won THEN 1 ELSE 0 END) AS wins
FROM bid_sample
GROUP BY bid_bucket
ORDER BY bid_bucket

The same from a terminal

The playground sends two kinds of request, and both are open.

RequestAddressGuide
An MCP tools/call messagePOST https://sandbox.precise.ai/api/mcpMCP and A2A
A governed queryPOST https://sandbox.precise.ai/api/sql/runREST API quickstart

The DuckDB tab of a query builds a script that reads the same public Parquet files the sandbox reads, at https://sandbox.precise.ai/data/parquet/<table>.parquet. Run it in the duckdb shell to check a result on your own machine. The scripts were checked with DuckDB 1.5.5.

↑↓ 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"