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
| Capability | Runtime | Status |
|---|---|---|
| Discover the sandbox MCP tools, resources and five prompts with your workspace key | Sandbox | Live |
| Discover product tools and four cards on configured credentialed Access | Sandbox | Preview |
Read the Access A2A agent card and send a JSON-RPC message to /api/a2a | Sandbox | Preview |
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):
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:
{"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.
initialize{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2025-11-25",
"capabilities": {},
"clientInfo": {
"name": "docs-example",
"version": "1.0"
}
}
}curl -sS --fail-with-body https://sandbox.precise.ai/api/mcp \
-H 'content-type: application/json' \
-H 'accept: application/json, text/event-stream' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2025-11-25",
"capabilities": {},
"clientInfo": {
"name": "docs-example",
"version": "1.0"
}
}
}'import json, sys, urllib.error, urllib.request
BODY = {
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2025-11-25",
"capabilities": {},
"clientInfo": {"name": "docs-example", "version": "1.0"},
},
}
request = urllib.request.Request(
"https://sandbox.precise.ai/api/mcp",
data=json.dumps(BODY).encode(),
headers={
"content-type": "application/json",
"accept": "application/json, text/event-stream",
},
method="POST",
)
try:
with urllib.request.urlopen(request) as response:
if response.headers.get_content_type() == "text/event-stream":
events = response.read().decode().splitlines()
answer = json.loads(next(line[5:] for line in reversed(events) if line.startswith("data:")))
else:
answer = json.load(response)
except urllib.error.HTTPError as error:
print(f"HTTP {error.code}: {error.read().decode(errors='replace')}", file=sys.stderr)
sys.exit(1)
if isinstance(answer, dict) and (answer.get("error") or (isinstance(answer.get("result"), dict) and answer["result"].get("isError"))):
print(json.dumps(answer, indent=2), file=sys.stderr)
sys.exit(1)
print(json.dumps(answer, indent=2))const body = {
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2025-11-25",
"capabilities": {},
"clientInfo": {
"name": "docs-example",
"version": "1.0"
}
}
};
const response = await fetch("https://sandbox.precise.ai/api/mcp", {
method: "POST",
headers: {"content-type":"application/json","accept":"application/json, text/event-stream"},
body: JSON.stringify(body),
});
const text = await response.text();
if (!response.ok) throw new Error(`HTTP ${response.status}: ${text}`);
const data = response.headers.get("content-type")?.includes("text/event-stream") ? text.split(/\r?\n/).filter(line => line.startsWith("data:")).at(-1)?.slice(5) : text;
const answer = JSON.parse(data ?? "");
if (answer?.error || answer?.result?.isError) throw new Error(text);
console.log(answer);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.
tools/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": {}
}
}
}curl -sS --fail-with-body https://sandbox.precise.ai/api/mcp \
-H 'content-type: application/json' \
-H 'accept: application/json, text/event-stream' \
-H 'mcp-protocol-version: 2026-07-28' \
-H 'mcp-method: tools/call' \
-H 'mcp-name: size_holdout' \
-d '{
"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": {}
}
}
}'import json, sys, urllib.error, urllib.request
BODY = {
"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": {},
},
},
}
request = urllib.request.Request(
"https://sandbox.precise.ai/api/mcp",
data=json.dumps(BODY).encode(),
headers={
"content-type": "application/json",
"accept": "application/json, text/event-stream",
"mcp-protocol-version": "2026-07-28",
"mcp-method": "tools/call",
"mcp-name": "size_holdout",
},
method="POST",
)
try:
with urllib.request.urlopen(request) as response:
if response.headers.get_content_type() == "text/event-stream":
events = response.read().decode().splitlines()
answer = json.loads(next(line[5:] for line in reversed(events) if line.startswith("data:")))
else:
answer = json.load(response)
except urllib.error.HTTPError as error:
print(f"HTTP {error.code}: {error.read().decode(errors='replace')}", file=sys.stderr)
sys.exit(1)
if isinstance(answer, dict) and (answer.get("error") or (isinstance(answer.get("result"), dict) and answer["result"].get("isError"))):
print(json.dumps(answer, indent=2), file=sys.stderr)
sys.exit(1)
print(json.dumps(answer, indent=2))const body = {
"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": {}
}
}
};
const response = await fetch("https://sandbox.precise.ai/api/mcp", {
method: "POST",
headers: {"content-type":"application/json","accept":"application/json, text/event-stream","mcp-protocol-version":"2026-07-28","mcp-method":"tools/call","mcp-name":"size_holdout"},
body: JSON.stringify(body),
});
const text = await response.text();
if (!response.ok) throw new Error(`HTTP ${response.status}: ${text}`);
const data = response.headers.get("content-type")?.includes("text/event-stream") ? text.split(/\r?\n/).filter(line => line.startsWith("data:")).at(-1)?.slice(5) : text;
const answer = JSON.parse(data ?? "");
if (answer?.error || answer?.result?.isError) throw new Error(text);
console.log(answer);The ten tools
tools/list{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}curl -sS --fail-with-body https://sandbox.precise.ai/api/mcp \
-H 'content-type: application/json' \
-H 'accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'import json, sys, urllib.error, urllib.request
BODY = {"jsonrpc": "2.0", "id": 1, "method": "tools/list"}
request = urllib.request.Request(
"https://sandbox.precise.ai/api/mcp",
data=json.dumps(BODY).encode(),
headers={
"content-type": "application/json",
"accept": "application/json, text/event-stream",
},
method="POST",
)
try:
with urllib.request.urlopen(request) as response:
if response.headers.get_content_type() == "text/event-stream":
events = response.read().decode().splitlines()
answer = json.loads(next(line[5:] for line in reversed(events) if line.startswith("data:")))
else:
answer = json.load(response)
except urllib.error.HTTPError as error:
print(f"HTTP {error.code}: {error.read().decode(errors='replace')}", file=sys.stderr)
sys.exit(1)
if isinstance(answer, dict) and (answer.get("error") or (isinstance(answer.get("result"), dict) and answer["result"].get("isError"))):
print(json.dumps(answer, indent=2), file=sys.stderr)
sys.exit(1)
print(json.dumps(answer, indent=2))const body = {
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
};
const response = await fetch("https://sandbox.precise.ai/api/mcp", {
method: "POST",
headers: {"content-type":"application/json","accept":"application/json, text/event-stream"},
body: JSON.stringify(body),
});
const text = await response.text();
if (!response.ok) throw new Error(`HTTP ${response.status}: ${text}`);
const data = response.headers.get("content-type")?.includes("text/event-stream") ? text.split(/\r?\n/).filter(line => line.startsWith("data:")).at(-1)?.slice(5) : text;
const answer = JSON.parse(data ?? "");
if (answer?.error || answer?.result?.isError) throw new Error(text);
console.log(answer);| Tool | What it answers | Main inputs | Scope |
|---|---|---|---|
get_guide | What the tables, measures, methods and workflows mean | section, name | Workspace key (precise:read) |
get_book | The book, a search of its orders, or one order in full | id, query, format, holdout, campaign_id, limit, offset | Workspace key (precise:read) |
query | One read-only SQL query or one structured join | sql or join_spec, max_rows (1 to 200), timeout_ms (100 to 120,000) | Workspace key (precise:query) |
run_analysis | One Gateway method or one workflow | method or workflow, order_id, fixture, describe, list_contracts | Workspace key (precise:run) |
size_holdout | The smallest Audience Holdout that detects a lift, or what a test can detect | order_id, or baseline_rate, mde, daily_volume, max_days, max_holdout_pct, alpha, power | Workspace key (precise:run) |
get_calls | The record of scored Decisions, or one Decision | call_id, status, order_id, campaign_id, limit | Workspace key (precise:read) |
inspect_audit | A verified run, reopened by its run_id | run_id | Workspace key (precise:read) |
make_call | Records a Decision and its forecast range before spend moves | known, chosen, predicted_value, lower, upper, confidence_level, gateway_run_id | Workspace key (precise:record) |
score_call | Scores a recorded Decision against its outcome | call_id, realized_value, lesson | Workspace key (precise:record) |
advance_time | Moves the workspace clock | hours (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.
tools/call · get_book{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "get_book",
"arguments": {}
}
}curl -sS --fail-with-body https://sandbox.precise.ai/api/mcp \
-H 'content-type: application/json' \
-H 'accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_book","arguments":{}}}'import json, sys, urllib.error, urllib.request
BODY = {
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {"name": "get_book", "arguments": {}},
}
request = urllib.request.Request(
"https://sandbox.precise.ai/api/mcp",
data=json.dumps(BODY).encode(),
headers={
"content-type": "application/json",
"accept": "application/json, text/event-stream",
},
method="POST",
)
try:
with urllib.request.urlopen(request) as response:
if response.headers.get_content_type() == "text/event-stream":
events = response.read().decode().splitlines()
answer = json.loads(next(line[5:] for line in reversed(events) if line.startswith("data:")))
else:
answer = json.load(response)
except urllib.error.HTTPError as error:
print(f"HTTP {error.code}: {error.read().decode(errors='replace')}", file=sys.stderr)
sys.exit(1)
if isinstance(answer, dict) and (answer.get("error") or (isinstance(answer.get("result"), dict) and answer["result"].get("isError"))):
print(json.dumps(answer, indent=2), file=sys.stderr)
sys.exit(1)
print(json.dumps(answer, indent=2))const body = {
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "get_book",
"arguments": {}
}
};
const response = await fetch("https://sandbox.precise.ai/api/mcp", {
method: "POST",
headers: {"content-type":"application/json","accept":"application/json, text/event-stream"},
body: JSON.stringify(body),
});
const text = await response.text();
if (!response.ok) throw new Error(`HTTP ${response.status}: ${text}`);
const data = response.headers.get("content-type")?.includes("text/event-stream") ? text.split(/\r?\n/).filter(line => line.startsWith("data:")).at(-1)?.slice(5) : text;
const answer = JSON.parse(data ?? "");
if (answer?.error || answer?.result?.isError) throw new Error(text);
console.log(answer);Query it. The answer is three rows, led by online video at $9,262,672.56 of media spend.
tools/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"
}
}
}curl -sS --fail-with-body https://sandbox.precise.ai/api/mcp \
-H 'content-type: application/json' \
-H 'accept: application/json, text/event-stream' \
-d '{
"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"
}
}
}'import json, sys, urllib.error, urllib.request
BODY = {
"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",
},
},
}
request = urllib.request.Request(
"https://sandbox.precise.ai/api/mcp",
data=json.dumps(BODY).encode(),
headers={
"content-type": "application/json",
"accept": "application/json, text/event-stream",
},
method="POST",
)
try:
with urllib.request.urlopen(request) as response:
if response.headers.get_content_type() == "text/event-stream":
events = response.read().decode().splitlines()
answer = json.loads(next(line[5:] for line in reversed(events) if line.startswith("data:")))
else:
answer = json.load(response)
except urllib.error.HTTPError as error:
print(f"HTTP {error.code}: {error.read().decode(errors='replace')}", file=sys.stderr)
sys.exit(1)
if isinstance(answer, dict) and (answer.get("error") or (isinstance(answer.get("result"), dict) and answer["result"].get("isError"))):
print(json.dumps(answer, indent=2), file=sys.stderr)
sys.exit(1)
print(json.dumps(answer, indent=2))const body = {
"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"
}
}
};
const response = await fetch("https://sandbox.precise.ai/api/mcp", {
method: "POST",
headers: {"content-type":"application/json","accept":"application/json, text/event-stream"},
body: JSON.stringify(body),
});
const text = await response.text();
if (!response.ok) throw new Error(`HTTP ${response.status}: ${text}`);
const data = response.headers.get("content-type")?.includes("text/event-stream") ? text.split(/\r?\n/).filter(line => line.startsWith("data:")).at(-1)?.slice(5) : text;
const answer = JSON.parse(data ?? "");
if (answer?.error || answer?.result?.isError) throw new Error(text);
console.log(answer);-- Paste into the duckdb shell. It reads the same public Parquet files the sandbox reads.
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, 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.
tools/call · size_holdout{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "size_holdout",
"arguments": {
"order_id": "ORD-067"
}
}
}curl -sS --fail-with-body https://sandbox.precise.ai/api/mcp \
-H 'content-type: application/json' \
-H 'accept: application/json, text/event-stream' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "size_holdout",
"arguments": {
"order_id": "ORD-067"
}
}
}'import json, sys, urllib.error, urllib.request
BODY = {
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {"name": "size_holdout", "arguments": {"order_id": "ORD-067"}},
}
request = urllib.request.Request(
"https://sandbox.precise.ai/api/mcp",
data=json.dumps(BODY).encode(),
headers={
"content-type": "application/json",
"accept": "application/json, text/event-stream",
},
method="POST",
)
try:
with urllib.request.urlopen(request) as response:
if response.headers.get_content_type() == "text/event-stream":
events = response.read().decode().splitlines()
answer = json.loads(next(line[5:] for line in reversed(events) if line.startswith("data:")))
else:
answer = json.load(response)
except urllib.error.HTTPError as error:
print(f"HTTP {error.code}: {error.read().decode(errors='replace')}", file=sys.stderr)
sys.exit(1)
if isinstance(answer, dict) and (answer.get("error") or (isinstance(answer.get("result"), dict) and answer["result"].get("isError"))):
print(json.dumps(answer, indent=2), file=sys.stderr)
sys.exit(1)
print(json.dumps(answer, indent=2))const body = {
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "size_holdout",
"arguments": {
"order_id": "ORD-067"
}
}
};
const response = await fetch("https://sandbox.precise.ai/api/mcp", {
method: "POST",
headers: {"content-type":"application/json","accept":"application/json, text/event-stream"},
body: JSON.stringify(body),
});
const text = await response.text();
if (!response.ok) throw new Error(`HTTP ${response.status}: ${text}`);
const data = response.headers.get("content-type")?.includes("text/event-stream") ? text.split(/\r?\n/).filter(line => line.startsWith("data:")).at(-1)?.slice(5) : text;
const answer = JSON.parse(data ?? "");
if (answer?.error || answer?.result?.isError) throw new Error(text);
console.log(answer);Resources and prompts
| Resource | Holds |
|---|---|
precise://guide | What the tables, measures, methods and workflows mean, under one digest |
precise://catalog | The 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 |
resources/read · precise://guide{
"jsonrpc": "2.0",
"id": 1,
"method": "resources/read",
"params": {
"uri": "precise://guide"
}
}curl -sS --fail-with-body https://sandbox.precise.ai/api/mcp \
-H 'content-type: application/json' \
-H 'accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"resources/read","params":{"uri":"precise://guide"}}'import json, sys, urllib.error, urllib.request
BODY = {
"jsonrpc": "2.0",
"id": 1,
"method": "resources/read",
"params": {"uri": "precise://guide"},
}
request = urllib.request.Request(
"https://sandbox.precise.ai/api/mcp",
data=json.dumps(BODY).encode(),
headers={
"content-type": "application/json",
"accept": "application/json, text/event-stream",
},
method="POST",
)
try:
with urllib.request.urlopen(request) as response:
if response.headers.get_content_type() == "text/event-stream":
events = response.read().decode().splitlines()
answer = json.loads(next(line[5:] for line in reversed(events) if line.startswith("data:")))
else:
answer = json.load(response)
except urllib.error.HTTPError as error:
print(f"HTTP {error.code}: {error.read().decode(errors='replace')}", file=sys.stderr)
sys.exit(1)
if isinstance(answer, dict) and (answer.get("error") or (isinstance(answer.get("result"), dict) and answer["result"].get("isError"))):
print(json.dumps(answer, indent=2), file=sys.stderr)
sys.exit(1)
print(json.dumps(answer, indent=2))const body = {
"jsonrpc": "2.0",
"id": 1,
"method": "resources/read",
"params": {
"uri": "precise://guide"
}
};
const response = await fetch("https://sandbox.precise.ai/api/mcp", {
method: "POST",
headers: {"content-type":"application/json","accept":"application/json, text/event-stream"},
body: JSON.stringify(body),
});
const text = await response.text();
if (!response.ok) throw new Error(`HTTP ${response.status}: ${text}`);
const data = response.headers.get("content-type")?.includes("text/event-stream") ? text.split(/\r?\n/).filter(line => line.startsWith("data:")).at(-1)?.slice(5) : text;
const answer = JSON.parse(data ?? "");
if (answer?.error || answer?.result?.isError) throw new Error(text);
console.log(answer);There is one prompt per workflow.
| Prompt | Steps | The question it answers |
|---|---|---|
understand-the-book | 20 | Where is spend leaking, and which signals are confounded? |
find-the-next-move | 10 | Which reallocation or bid change earns the most for its risk? |
design-the-test | 5 | What is the smallest Audience Holdout that can detect the lift you care about? |
measure-and-learn | 11 | Did the decision land inside its predicted range once outcomes matured? |
plan-adaptive-campaign-loop | 5 | How 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.
{
"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.
| Tool | Card URI |
|---|---|
get_overview | ui://precise/cards/figure-card |
get_decision | ui://precise/cards/decision-card |
size_holdout | ui://precise/cards/holdout-dial-card |
get_proof_file | ui://precise/cards/proof-verifier-card |
verify_proof_file | ui://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.
POST /api/a2acurl -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?"
}
}
}
]
}
}
}'import json, os, sys, urllib.error, urllib.request
BODY = {
"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?"}},
},
],
},
},
}
request = urllib.request.Request(
os.environ["PRECISE_URL"] + "/api/a2a",
data=json.dumps(BODY).encode(),
headers={"content-type": "application/json"},
method="POST",
)
try:
with urllib.request.urlopen(request) as response:
answer = json.load(response)
except urllib.error.HTTPError as error:
print(f"HTTP {error.code}: {error.read().decode(errors='replace')}", file=sys.stderr)
sys.exit(1)
if isinstance(answer, dict) and (answer.get("error") or (isinstance(answer.get("result"), dict) and answer["result"].get("isError"))):
print(json.dumps(answer, indent=2), file=sys.stderr)
sys.exit(1)
print(json.dumps(answer, indent=2))const body = {
"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?"
}
}
}
]
}
}
};
const response = await fetch(`${process.env.PRECISE_URL}/api/a2a`, {
method: "POST",
headers: {"content-type":"application/json"},
body: JSON.stringify(body),
});
const text = await response.text();
if (!response.ok) throw new Error(`HTTP ${response.status}: ${text}`);
const answer = JSON.parse(text);
if (answer?.error || answer?.result?.isError) throw new Error(text);
console.log(answer);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.
Related
REST API quickstart · API and MCP playground · Limits and errors