---
name: precise-sandbox
description: Use your credentialed Precise sandbox workspace to measure a sample media-buying book. Query it with SQL, run attribution and holdout methods, size a test, and reopen any run by its id using your per-company workspace key (penv_...). Use when a task involves campaign measurement, holdout design, deal-versus-open-auction comparisons, or learning how Precise's MCP server answers.
---

# Precise sandbox

The sandbox at `https://sandbox.precise.ai` runs Precise's measurement engine on a sample quarter of media buying: 84 orders, 48 campaigns, ten tables, all sample data. Every company gets an isolated sandbox workspace and scoped `penv_...` key requested at `https://sandbox.precise.ai`.

## Connect

MCP over Streamable HTTP, stateless, authenticated with your per-company workspace key (`Authorization: Bearer $PRECISE_SANDBOX_KEY` or the URL-scoped endpoint `/api/mcp/$PRECISE_SANDBOX_KEY`):

```
POST https://sandbox.precise.ai/api/mcp
authorization: Bearer <YOUR_SANDBOX_KEY>
content-type: application/json
accept: application/json, text/event-stream
```

The `accept` header must list both types, or the server answers 406. Protocol revisions `2026-07-28`, `2025-11-25`, `2025-06-18` and `2025-03-26` are served. A `tools/list` works with no `initialize`.

For a client: `claude mcp add --transport http precise-sandbox https://sandbox.precise.ai/api/mcp --header "Authorization: Bearer $PRECISE_SANDBOX_KEY"`, or `codex mcp add precise-sandbox --url "https://sandbox.precise.ai/api/mcp/$PRECISE_SANDBOX_KEY"`.

## Work in this order

1. `get_guide` with no arguments. It returns the tables, the measures and their SQL, the verbs, the workflows and the reading rules. Read it before you query.
2. `get_book` with no arguments for the book's size and its record of scored Decisions. `{"id": "ORD-012"}` reads one order in full.
3. `query` for one read-only `SELECT`: `{"sql": "..."}`. At most 200 rows and 20,000 characters. The ten tables are `orders`, `line_items`, `deals`, `segments`, `tests`, `invoices`, `gold_daily_cube`, `outcomes`, `wins`, `bid_sample`.
4. `run_analysis` for a method: `{"list_contracts": true}` lists them, `{"describe": "power/holdout"}` reads one contract, `{"method": "comparison/holdout-integrity", "order_id": "ORD-012"}` runs one on the book. Some methods run on their own reference input and say so in the answer.
5. `size_holdout` with `{"order_id": "ORD-012"}` for the lowest feasible share on the sizing grid, then the shortest duration at that share. An underpowered test succeeds with a limitation.
6. `inspect_audit` with `{"run_id": "..."}` to reopen a run you made.

Without a workspace key, MCP and REST tool calls answer HTTP 401 (`workspace_required`). Request a private per-company workspace key on `https://sandbox.precise.ai`; `make_call`, `score_call`, and `advance_time` persist state strictly inside your company's isolated enclave.

## Read an answer

- The first content part is a plain sentence. `Measured:` is what the data shows. `Said:` is what Precise concludes or expects. Keep the two apart when you report.
- `structuredContent` carries the figures. A query, a method run and a workflow run also carry a `run_id` and a `result_digest`. Quote the `run_id` with any number you report so a person can reopen it.
- A figure is sample data. Say so when you report it.
- When a method cannot support a claim it says so in the answer, for example that traffic can detect a lift no smaller than a stated size. Report that as the answer.

## Check a number yourself

Every table is also a public Parquet file at `https://sandbox.precise.ai/data/parquet/<table>.parquet`. The same `SELECT` in DuckDB over those files returns the same rows.

```sql
CREATE OR REPLACE VIEW gold_daily_cube AS SELECT * FROM read_parquet('https://sandbox.precise.ai/data/parquet/gold_daily_cube.parquet');
SELECT format, ROUND(SUM(media_spend_usd), 2) AS media_spend_usd FROM gold_daily_cube GROUP BY format;
```

## Limits

- Queries take turns: one running and two waiting per caller. A full queue answers 429 `query_busy` with `Retry-After` in seconds; wait, then send the same request.
- A query still running at its `timeout_ms` answers 504 `query_pending` with the `run_id`.
- A query that names a personal-data field such as `email` answers 400 `pii_not_accepted`. Count or group in its place.
- The REST form of a query is `POST https://sandbox.precise.ai/api/sql/run` with `{"sql": "..."}`. It returns the same run as the `query` tool.

## More

- All pages as Markdown in one file: `llms-full.txt` beside this file. The page index: `llms.txt`.
- The server card: `https://sandbox.precise.ai/.well-known/mcp/server-card.json`.
- The Precise app API (decisions, approval, Scorekeeper, spend checks, proof files) is described in `openapi.json` beside this file. It describes the Access public-test profile. Point `accessOrigin` at your Access deployment. Access also serves the thin app. The public sandbox has its own MCP catalog.
