# DataParlez: context for AI agents

> Read this first. DataParlez answers questions about a database in plain language. You reach it as an MCP server: send the person's question, get back JSON with the answer, the data and the exact SQL that produced it.

Source: https://dataparlez.ai/ai-context.md

## Connect

- **Server:** `https://demo.dataparlez.ai/mcp` (MCP over streamable HTTP).
- **Sign-in (apps):** OAuth 2.1 with PKCE. The server announces its sign-in in its protected-resource metadata. The person signs in in a browser with a work email and a one-time code, then allows your app on an approval screen. Apps with a published client identity document are recognised by name; others may register dynamically.
- **Key (scripts):** `Authorization: Bearer gzsk_live_...`. People make named, revocable keys on their account page, up to five each.
- **Access:** by invitation, work email only. Request access at https://demo.dataparlez.ai/.

## Tools

### ask

Ask one question in plain words. DataParlez writes the SQL, runs it read-only and returns JSON.

| Parameter | Type | What to send |
|---|---|---|
| `dataset` | string, required | The dataset name. The demo has one sample database: send `demo`, any value reaches it |
| `question` | string, required | The person's question with its meaning unchanged: same metric, period, population and filters. Make a follow-up a full question |
| `agentic_level` | string, optional | Leave unset. The server sets it |

### explain_results

Explain how an answer was produced: the tables chosen, the SQL at each stage, the checks, retries and timing.

| Parameter | Type | What to send |
|---|---|---|
| `trace_id` | string, required | The `trace_id` of an `ask` result. Only the person who asked can read it back |

## What happens to a question

1. DataParlez finds the parts of the database the question is about, using its curated metadata: table and column descriptions, business terms, known query patterns.
2. An AI model writes the SQL.
3. The SQL is checked before it runs: it must only read, it must fit the database's structure, and a review step looks at it.
4. The SQL runs read-only, with a row limit and a time limit.
5. You get JSON back.

## Read the result in this order

1. **`error` is set:** there is no answer. `error_type` `busy`: try again in a minute. `deadline_exceeded` or `query_timeout`: too heavy, suggest a narrower question. Anything else: say it failed, with the `trace_id`. Never retry by changing settings.
2. **`needs_clarification` is true:** ask the person the `clarification_message`, nothing else.
3. **`needs_approval` is true:** the query has not run. Show it and say so.
4. **Otherwise, an answer.** Show, in this order: a sentence written from `rows`; the data (a table of at most 10 rows, then how many more from `row_count`); the whole `sql` in a code block, never shortened or edited; one follow-up question in plain words; then everything after `---` in `answer`, exactly as it is (the footer with the confidence line and the `trace_id`).

Make numbers readable (4256527.0000 as 4,256,527) but never add, drop or compute values that are not in `rows`. A missing value is not 0.

## Limits

| Limit | Value on the demo |
|---|---|
| Tool calls | 100 a month and 5 a minute per person (Trial plan). Each call is counted before it runs; a call that ends without a result is not counted |
| Time per question | 210 seconds, then `deadline_exceeded` |
| Questions at once | 2 on the whole server, then `busy` |
| Access to data | Read-only |

When the allowance is used up, the call returns a short message saying so and when the count starts again. Show it to the person.

## More

- Docs index for agents: https://dataparlez.ai/llms.txt
- Every doc in one file: https://dataparlez.ai/llms-full.txt
- Contact: hello@dataparlez.ai
