What an AI assistant is shown when it connects to Datafor
, Datafor team
Connecting an assistant such as Claude or ChatGPT to a company’s analytics raises a fair question from whoever owns the data: what can it see now? A description of the design answers part of it. The rest is easier to judge from the responses themselves, so we connected an assistant to a Datafor server holding sample data and kept what came back.
Four tools, all of them read-only
Over MCP, the Model Context Protocol, a connected client gets four tools from Datafor: list_models, explore_model, generate_sample_questions and ask_datafor. None of them changes anything in Datafor, and none takes SQL. The assistant can find out which models exist, read what is in one, and ask a question in words.
Each call runs under the account of the person who connected the client. Whatever that person cannot open in Datafor is absent from the responses.
Which models exist
list_models returns names and descriptions. Searching for the sample retailer returned one entry:
{
"models": [{
"name": "Larkwood Retail Sales",
"description": "Sales, margin and returns of Larkwood, a fictional US home and lifestyle retailer with 25 stores and online channels. One row per order line, 2024-01 to 2025-12. Sample data for demonstration.",
"data_source": "Larkwood Retail Demo"
}],
"count": 1,
…
}
The description is the one the model’s author wrote. It is the first thing an assistant reads about a model, and a sentence saying what one row is and which period the data covers saves it from guessing.
What is inside a model
explore_model describes a single model. For Larkwood it returned 19 metrics, 35 dimension levels and 16 time fields. A metric looks like this:
{
"id": "calculated_measure::Return Rate",
"name": "Return Rate",
"label": "Return Rate",
"kind": "calculated_measure",
"description": "Returned units divided by units sold. Returns are counted in the month of the original order",
"aggregation": "calculated",
"additive": false,
"format": "0.0%"
}
That is the whole entry. The assistant learns the name, the business meaning, that the value is a ratio which must not be summed, and how to display it. It is not given the formula itself, any SQL, or a way to reach the database. The data source appears only by its name.
One line near the end of the response is easy to miss: "metadata_source": "datafor_permission_filtered". The list is the model as this user may see it.
Asking a question
We asked: which five stores had the highest return rate in 2025? ask_datafor ran one query and returned three things. The first is the rows.
| Store | Return Rate |
|---|---|
| Nashville The Gulch | 6.6% |
| San Francisco Union Square | 6.3% |
| Chicago Oak Brook | 6.3% |
| Dallas NorthPark | 6.3% |
| Seattle Capitol Hill | 6.1% |
The second is the query that produced them, written in the model’s terms:
{
"metrics": [{ "label": "Return Rate", … }],
"groupings": [{ "label": "Store" }],
"times": [{
"field": "Date", "role": "filter", "grain": "year",
"start_date": "2025-01-01", "end_date": "2025-12-31"
}],
"rankings": [{
"direction": "top", "limit": 5,
"metrics": ["Return Rate"], "groupings": ["Store"]
}],
"row_limit": 5
}
Anyone who can read a pivot table can read this and see that “2025” became the calendar year and “highest” became a ranking on Return Rate. There is no SQL in the response, because the language model never wrote any. Datafor built the database query from this plan and ran it itself.
The third is a list of disclosures, which the client is required to pass on to the person asking. This answer came with one:
The model’s Return Rate computes Returned Units divided by Units Sold, while the certified Return Rate definition states returned amount divided by Gross Sales. The certified definition is established for product category and month, so consistency of this store-level reading is unconfirmed.
The sample server’s Metrics Library holds a certified Return Rate that is defined on amounts. The Larkwood model computes its own on units. Both are reasonable, they would give different percentages, and the response says which one the number is. A person who got 6.6% in a chat window without that note would have no reason to wonder.
When the question names no model
The model is optional. We asked “What was gross margin by region last quarter?” and named none. The response carried the answer along with an account of the choice:
"resolved_model": {
"label": "Retail Chain Operations",
"basis": "metric_library",
"matched_metric_names": ["Gross Margin Amount"],
…
}
Datafor matched “gross margin” to a metric in the Metrics Library, which is bound to that model, and read “last quarter” as 1 July to 30 September 2026. Both decisions are in the response where they can be checked. Had two models been equally plausible, the status would have been clarification_needed with the candidates listed, and the assistant would have asked which one was meant.
What a response can say besides “ok”
An answer is one of several outcomes, and the others matter as much.
| Status | What it means |
|---|---|
partial |
Part of the question was answered, and the response says which part was not |
clarification_needed |
Datafor needs a choice, such as the model or a member |
needs_split |
The question needs several queries, to be asked one at a time |
unsupported |
The model cannot answer this, and the assistant is told not to answer from general knowledge |
pending |
The analysis is still running and can be collected later |
The instructions Datafor gives the client are short and strict. It must not alter a value, it must relay every disclosure, and anything it calculates itself has to be labelled as its own work. A result holds 200 rows unless more are asked for, up to 1,000.
What the connection is made of
The assistant signs in with a personal token. The token holds a user name and an expiry date. It does not hold roles, so the permissions that apply are the ones the person has at the moment of each call. A token is shown once when it is created, lasts 7, 30, 90 or 180 days within the limit an administrator sets, and can be revoked by itself. One that goes unused for 90 days stops working.
Revoking a token ends its sessions at once. A client already connected over MCP can keep working for up to a minute, because the server caches token checks for 60 seconds.
What we would check on our own data
Three things, in this order. Read your models’ descriptions as a stranger would, since they are what the assistant reads. Connect with the account of someone who has restricted access, ask for a total you know, and compare. Then ask a question with a vague word in it and see whether the disclosure tells you how the word was read.
Connect your AI client has the setup for each assistant, and Connect AI Clients in the documentation covers every setting. For what happens inside Datafor between the question and the query, see How the Datafor AI Agent turns a question into a query.