SQAI
OfficialThis server exposes four read-only, deterministic tools for AI agents to discover data sources, run governed structured queries/computations, dry-run explanations, and fetch full stored results.
listSources: Discover connected data sources with exact field names, types, and allowed operations; search the computation capability catalog; list a module's function signatures.
queryData: Execute one deterministic, read-only request — either a tabular query (aggregations, grouping, filtering) or a computation (math/stats/financial/vector/simulation) using bindings to pull columns from sources; large results are truncated and retrievable via
result_id.explainQuery: Dry-run a
queryDatarequest without executing it — get the resolved plan,plan_hash, validation, computation signature preview,invocation_hash, and whether a seed is required.getResult: Fetch the full stored result of an earlier
queryDatacall byresult_idwhen the preview was truncated; results are in-memory with a short TTL.All execution requires a free community login or
SQAI_API_KEY; introspection needs no credentials. All tools are annotated read-only, idempotent, non-destructive, and closed-world.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@SQAIWhich region had the highest total revenue last quarter?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
SQAI — Structured Query AI
SQAI is the deterministic, read-only structured-data tool for AI agents, with governed execution and replayable provenance.
Apache-2.0 · TypeScript + Python · built on Algenta as the underlying substrate · a Thyn product
The model proposes meaning. SQAI controls execution: typed intent in, policy-checked deterministic execution, replayable results with full provenance out. No raw SQL, no eval, no write path.
Architecture
Layer | Package | What it is |
AI SDK tools |
| Three Vercel AI SDK 7 tools — |
Product SDK |
| SQAI query plane + full computation plane |
Product SDK |
| Same SQAI surface, 1:1 vocabulary |
CLI |
|
|
Capability contract | Embedded SQAI contract | The generated, hash-pinned inventory of every capability SQAI exposes |
Execution substrate | Algenta (exact-pinned) | Underlying deterministic execution substrate and managed signed runtime bundle |
Related MCP server: governed-rag-mcp
Quickstart (AI SDK)
import { generateText } from "ai";
import { createSQAI } from "@thyn-ai/sqai-ai-sdk";
const sqai = createSQAI({ sources: [{ data: "./data/sales.csv", name: "sales" }] });
const { text } = await generateText({
model: "openai/gpt-5-mini",
tools: sqai.tools(),
prompt: "Which region had the highest total revenue?",
});No server. No daemon for the query plane. The computation plane provisions a signed managed runtime transparently on first use.
MCP server
The same four governed tools are available to any MCP host (Claude Desktop, Cursor, …) as a stdio server — descriptions, Zod schemas, and execute functions are read straight off the AI-SDK tool objects, never forked:
npx @thyn-ai/sqai-mcp{
"mcpServers": {
"sqai": {
"command": "npx",
"args": ["-y", "@thyn-ai/sqai-mcp"],
"env": {
"SQAI_SOURCES": "[{\"data\": \"./data/sales.csv\", \"name\": \"sales\"}]"
}
}
}
}Introspection (initialize / tools/list) needs no credentials — zero
environment is a valid configuration. Executing any of the four tools requires
a free community login (sqai login once / device registration, or
SQAI_API_KEY) — fully offline thereafter; without it every tools/call returns
a structured login_required error. SQAI_DEPLOYMENT_URL keeps its usual
semantics from @thyn-ai/sqai.
Tool | What it does |
| Discovery: sources with exact field names, types, and allowed operations; computation-catalog search; per-module signatures. |
| One deterministic, read-only query or computation; truncated results stay retrievable via |
| Dry-run: resolved plan, |
All three are annotated readOnlyHint: true, destructiveHint: false,
idempotentHint: true, openWorldHint: false. All three execute under the one
uniform license gate: free on 1 machine with a one-time device registration
(sqai login) — licensing moves a signed token, never your data; without it,
every tool call — local CSV reads included — returns a structured
login_required error by design.
What works today
Query plane (connect / resolve / query / verify / ask) — in-process, both languages
Full SQAI computation plane behind capability-contract validation
Policy allow-lists (sources, fields, functions) the model can never override
Cross-language conformance: identical values,
plan_hash,intent_signatureModel-context truncation with opaque result handles
Repository layout
contracts/ generated capability contract + tested version pair
packages/sdk/ @thyn-ai/sqai (TypeScript product SDK)
packages/ai-sdk/ @thyn-ai/sqai-ai-sdk (Vercel AI SDK tools)
packages/cli/ sqai CLI (doctor, runtime verbs)
packages/mcp/ @thyn-ai/sqai-mcp (MCP stdio server)
packages/python-sdk/ sqai (PyPI)
examples/ runnable examples (AI SDK registry example)
scripts/ contract sync + parity gate
docs/ GitBook (docs.sqai.com)Key documents
Doc | Purpose |
TypeScript quickstart | |
Python quickstart | |
Tool schemas and truncation contract | |
Hashes, envelopes, "deterministic within the declared execution scope" | |
Free developer tier, entitlements, runtime bundle trust | |
Security policy |
Available Tools
4 toolsexplainQueryARead-onlyIdempotent
Dry-run a queryData request without executing it. kind 'query': resolve and verify the plan (resolved_plan, plan steps, plan_hash, confidence, validated). kind 'computation': check the capability exists and get its exact signature, a preview invocation_hash, and whether a seed is required. Use this to debug clarifications and rejections before running queryData. Execution requires a free community login (sqai login device registration, or SQAI_API_KEY) — fully offline thereafter.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The tool's annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=falseais. The description adds meaningful behavioral context beyond annotations: it confirms no execution occurs, details what the dry-run returns for each kind (resolved_plan, plan_hash, invocation_hash, etc.), and notes the login requirement with offline operation afterward. This is exactly the kind of context that aids correct invocation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact yet information-dense. The first sentence states the core purpose immediately. The second sentence adds specific return artifacts for both kinds, a usage directive, and a prerequisite, with no filler. The structure is front-loaded and every clause earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's two distinct modes and complex schema, the description covers both modes completely, specifies what results to expect, explains when to use it, and notes environmental requirements. It does not need to explain return values because there is no output schema, and it correctly avoids redundancy with the input schema. No missing information blocks correct invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents parameters like metric, source, and seed. The description adds semantic value by explaining the role of the 'kind' discriminator and what each kind validates or returns, which is not explicit in the schema. However, it does not go into per-field detail for the spec objects, though the schema covers that thoroughly, so a 4 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with 'Dry-run a queryData request without executing it,' which clearly states the verb, resource, and key constraint. It then explains the two kind variants (query vs computation) and explicitly positions it against queryData, so an agent can distinguish it from the execution tool without needing to compare schemas.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives direct usage guidance: 'Use this to debug clarifications and rejections before running queryData.' This tells the agent when to select this tool over queryDataced and also implies the alternative. It further explains for computation kind what to check (capability existence, signature, seed requirement), covering both branches of behavior.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
getResultARead-onlyIdempotent
Fetch the full stored result of an earlier queryData call by its result_id. Use it when queryData returned truncated: true — the preview is capped for context, this returns every stored row/element (only results within the output-size cap, 10 MB by default, get a result_id at all). The store is in-memory and short-lived: default 15-minute TTL, evicted oldest-first under memory pressure. An unknown, expired, or evicted result_id returns a structured result_not_found error — re-run the original queryData request to regenerate. Read-only and idempotent; takes no other parameters. Execution requires a free community login (sqai login device registration, or SQAI_API_KEY) — fully offline thereafter.
| Name | Required | Description | Default |
|---|---|---|---|
| result_id | Yes | The result_id from a queryData ok result. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnly, idempotent, and non-destructive hints, but the description adds substantial behavioral context: in-memory storage, 15-minute TTL, oldest-first eviction under memory pressure, a structured result_not_found error, the 10 MB output-size cap, and authentication requirements. This is context the annotations cannot convey.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is front-loaded with purpose and usage, then moves through storage behavior, error handling, and auth. It is longer than average, but every sentence provides distinct information needed to call the tool reliably; no filler is present.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Even though there is no output schema, the description covers the result semantics (full vs. truncated), error behavior, storage lifecycle, size cap, and how to regenerate results. The single parameter is fully explained, leaving no critical gap in the agent's ability to use the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% and the schema already documents result_id as coming from a queryData ok result. The description goes beyond this by explaining the lifecycle of that id (expiry, eviction, regeneration) and what happens if the id is invalid. This adds actionable meaning beyond the bare schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb and resource ('Fetch the full stored result of an earlier queryData call by its result_id') and contrasts it with the truncated preview from queryData. It explicitly names the sibling tool it depends on and the condition under which it is relevant, so an agent can identify it without opening the schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It states exactly when to use this tool ('Use it when queryData returned truncated: true') and provides the alternative action when the result_id is unavailable: re-run the original queryData request. It also clarifies that the tool takes no other parameters, which thins the decision space for an agent.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
listSourcesARead-onlyIdempotent
Discover what SQAI can touch. No arguments: list connected data sources with exact field names, types, and allowed operations — call this before queryData so specs use exact names. With capabilitySearch: search the deterministic computation catalog and get matching modules. With module: list that module's functions with exact signatures. Execution requires a free community login (sqai login device registration, or SQAI_API_KEY) — fully offline thereafter.
| Name | Required | Description | Default |
|---|---|---|---|
| module | No | List a module's functions with exact signatures. | |
| capabilitySearch | No | Search the computation capability catalog; returns matching modules. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnly, idempotent, non-destructive, and closed-world behavior. The description adds meaningful context beyond those: auth requirements (free community login or SQAI_API_KEY), the deterministic nature of the computation catalog, and the offline-after-login behavior. This is useful but does not describe edge cases or exact output formatting.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is dense but organized: it front-loads the purpose, separates the three modes with clear markers, and ends with the necessary login note. Every sentence carries load-bearing information, with no filler or redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a no-required-params discovery tool with no output schema, the description tells the agent what to expect from each mode, states prerequisites (login/API key), and explains why it should be called before queryData. No important aspect of correct invocation is left unspecified.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3 and the schema already explains both optional parameters. The description adds the default no-argument mode and calls the capability catalog deterministic, but essentially restates the schema's parameter descriptions rather than adding substantial new semantics.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with the role ('Discover what SQAI can touch') and then specifies three concrete modes: listing connected data sources with exact field names/types/allowed operations, searching the capability catalog, and listing module functions with exact signatures. It also differentiates from the sibling queryData by instructing the agent to call it before queryData so specs use exact names.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives explicit guidance for the main workflow: 'call this before queryData so specs use exact names,' and it explains when to use the capabilitySearch and module variants. It does not explicitly state when to prefer queryData or explainQuery, so it stops short of full when/when-not coverage.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
queryDataARead-onlyIdempotent
Execute one deterministic, read-only SQAI request. Use kind 'query' for tabular questions (aggregations, grouping, filtering) over connected sources — call listSources first for exact field names. Use kind 'computation' for math (statistics, financial, vector/matrix, simulation) over arrays: never paste large data into args — use bindings to pull columns from connected sources. Simulation modules require a seed. Large results are truncated for context; the full result stays retrievable — pass the returned result_id to the getResult tool. Execution requires a free community login (sqai login device registration, or SQAI_API_KEY) — fully offline thereafter.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations declare readOnlyHint, idempotentHint, and destructiveHint=false, and the description aligns and reinforces these with 'deterministic, read-only'. It adds beyond annotations by disclosing truncation behavior ('Large results are truncated for context; the full result stays retrievable'), the authentication requirement ('free community login'), the seed requirement for simulations, and the offline capability. No contradictions; the description enhances the safety and behavior profile.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise for the tool's complexity—about 90 words—and front-loads the core purpose and kind routing before diving into details. Each sentence earns its place: kind distinctions, bindings advice, seed requirement, truncation handling, and auth. The only minor inefficiency is that the truncation detail could be seen as part of output behavior, but it is necessary context. It is dense but well-organized.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description is complete despite the tool's high complexity (two distinct schemas, QA vs computation). It explains both usage modes, the necessity of listSources for field discovery, the truncation-and-getResult recovery path, auth requirements, and the seed requirement for simulations. All critical invocation aspects are covered, and the absence of an output schema is mitigated by mentioning getResult and result_id. Nothing an agent needs to call it correctly is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% and includes descriptions for metric, source, group_by, module, function, bindings, seed, and filter fields. The description adds semantic context beyond the schema: it explains the conceptual distinction between query and computation kinds, advises using bindings instead of pasting data, and mentions the seed requirement explicitly. It doesn't enumerate every parameter name but adds strategic guidance on how to use them, which is valuable above the schema's individual descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('Execute'), a specific resource ('one deterministic, read-only SQAI request'), and distinguishes two usage kinds (query vs computation) with concrete examples. It explicitly names sibling tool listSources for discovery, preventing confusion with getResult and explainQuery. The purpose is unambiguous and actionable.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives explicit when-to-use guidance for each kind ('Use kind 'query' for tabular questions (aggregations, grouping, filtering)', 'Use kind 'computation' for math (statistics, financial, vector/matrix, simulation)'), states the alternative for large data (bindings vs pasting), and mentions the getResult tool for retrieving truncated results. It also covers prerequisites (listSources first, login requirements) and identifies when not to use it (never paste large data).
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v0.1.2- Added
getResult
3 tool updates
v0.1.0- First observed
explainQuery - First observed
listSources - First observed
queryData
TDQS
Scored across 4 tools
Each tool has a clearly distinct role: queryData executes, explainQuery dry-runs, getResult retrieves stored results, and listSources discovers sources/capabilities. Even the closely related queryData and explainQuery are unambiguously separated by execution versus planning. No two tools appear to do the same thing.
All four tool names follow the same camelCase verb_noun pattern: queryData, getResult, explainQuery, listSources. The naming is uniform and predictable, making the API easy to navigate. There are no mixed conventions or vague verbs.
Four tools is a well-scoped count for a read-only query and computation server. Each tool covers an essential stage of the workflow: discover, explain, execute, and retrieve. No tool feels redundant or missing from the core flow.
The tool surface fully covers the stated purpose: discovering data sources and computation modules, validating queries before execution, executing queries, and retrieving truncated results. The read-only nature means CRUD operations are not expected, so there are no obvious dead ends. The workflow is cohesive and self-contained.
Maintenance
Related MCP Connectors
Governed data discovery, exact queries, decisions, simulations, and runtime utilities over MCP.
Read-only public, governed enterprise knowledge published by GVE, with provenance and validation.
51- BasedashOAuthcom.basedash
Governed BI MCP. Ask questions of live company data and list workspace sources via OAuth.
Guarded MCP server for agent-readable business truth, provenance, readiness, and discovery.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceA read-only MCP server for querying telemetry data from configurable backends. Provides tools to list sources, describe schemas, run bounded queries, and compute aggregates.MIT
- AlicenseAqualityBmaintenanceProvides governed retrieval over MCP with hybrid search, strict confidence gating, and access control, exposing three read-only tools.3Apache 2.0

MCP DB Gatewayofficial
AlicenseNot gradedqualityBmaintenanceProvides governed, read-only PostgreSQL access for AI agents via MCP. Enforces schema/table allowlists, query limits, and audit events.MIT- FlicenseNot gradedqualityAmaintenanceProvides a stdio MCP server for Codex to inspect and query configured datasources, with tools for health checks, read-only queries, metadata, and fixed physical sessions with audit trails.16 npm-