NLQueries
OfficialThis server exposes an NLQueries MCP agent that answers natural-language questions over your databases and documents, with schema inspection, feedback, caching, and health tooling.
Query agents – ask natural-language questions (
query) and get SQL, answers, and citations; agents are discovered vialist_agentsand their tables/columns/foreign keys viaget_agent_schema.Feedback loop – rate query results as up/down (
submit_feedback) and optionally provide corrected SQL to improve future answers.Semantic cache management – inspect cache stats (
get_cache_stats) and clear an agent's cache after schema/data changes (invalidate_cache).Connector visibility – list registered database connectors with redacted credentials (
list_connectors).Query history – review recent queries and their feedback ratings per agent (
get_query_history).Health monitoring – check connectivity to LLM, Qdrant, embedding daemon, and configuration (
health).Conversational follow-ups, hybrid SQL/document answers, and multi-agent orchestration are supported by the underlying NLQueries engine.
Allows querying Amazon Redshift databases using natural language.
Allows querying Confluence documents and retrieving answers with citations.
Allows querying DuckDB databases using natural language.
Allows querying MySQL databases using natural language.
Allows querying Notion documents and retrieving answers with citations.
Uses OpenAI's language models to process natural language queries and generate SQL.
Allows querying PostgreSQL databases using natural language.
Allows querying Snowflake databases using natural language.
nlqueries-core
NLQueries Core is an open-source natural language to SQL engine — see nlqueries.com. It turns plain-English questions into validated SQL, builds a self-updating YAML knowledge base from your schema and query history, and exposes everything as an MCP server your AI assistant can call directly. It also answers questions from your documents (PDF, Word, Excel, Notion, Confluence) and can blend both in a single hybrid answer.
Links
Website — nlqueries.com
Documentation — nlqueries.com/docs/
Getting started — nlqueries.com/docs/getting-started.html
Supported databases — nlqueries.com/databases/
PyPI — nlqueries-core
Docker Hub — nlqueries/core
Related MCP server: Legion Database MCP Server
Features
Capability | Description |
Database connectors | PostgreSQL, MySQL, Snowflake, BigQuery, Redshift, SQL Server / Azure SQL, DuckDB, SQLite — plus a generic SQLAlchemy connector for any other SQLAlchemy-reachable database, driven by a connection URL |
Document connectors | PDF, Word, Excel, Notion, Confluence — ask questions over ingested documents with citations |
Query pipeline | Filter, cluster, and parameterize query history into reusable |
Knowledge base | Auto-generated YAML schema + capsule file, with coverage reporting via |
Multi-agent orchestration | Routes each question to a SQL agent, document agent, or both in parallel (hybrid) |
Conversational follow-ups | Carries context across questions so a follow-up like "and by region?" resolves against the previous query — on by default in |
Semantic cache | Returns previously-answered similar questions in under 50 ms, no LLM or DB round-trip |
Embedding daemon | Keeps the embedding model resident in memory — ~10 ms per call instead of ~9 s |
Feedback loop | Rate an answer with |
Regression checks |
|
dbt import |
|
LLM client | Anthropic, OpenAI, Amazon Bedrock, or any LiteLLM-supported provider |
MCP server | Query execution and schema/knowledge lookup exposed as MCP tools for Claude, Cursor, etc. |
CLI |
|
See docs/architecture.md (or read online) for how these pieces fit together.
Quickstart
Prerequisite: Python 3.11–3.14.
Option A — Docker (recommended)
Pulls the published nlqueries/core image from Docker Hub — no clone required, just the compose file:
curl -O https://raw.githubusercontent.com/nlqueries/nlqueries/main/docker-compose.ymlCreate a .env file next to it with one LLM key and a Qdrant key. Both are
required — compose refuses to start without QDRANT_API_KEY:
ANTHROPIC_API_KEY=sk-ant-...
# or OPENAI_API_KEY=sk-...
QDRANT_API_KEY=... # any random secret: openssl rand -hex 32Then start the stack:
docker compose upThis pulls nlqueries/core:latest and starts it alongside Qdrant (:6333), with the MCP server on :8080. Run CLI commands against the running stack from a second terminal:
docker exec -it nlqueries-core nlqueries healthOption B — pip install
pip install nlqueries-core
export ANTHROPIC_API_KEY=sk-ant-... # or OPENAI_API_KEY
nlqueries healthOptional extras for specific connectors:
pip install "nlqueries-core[mysql]" # MySQL
pip install "nlqueries-core[snowflake]" # Snowflake
pip install "nlqueries-core[bigquery]" # Google BigQuery
pip install "nlqueries-core[redshift]" # Amazon Redshift
pip install "nlqueries-core[mssql]" # SQL Server / Azure SQL
pip install "nlqueries-core[duckdb]" # DuckDB
pip install "nlqueries-core[docs]" # PDF / Word / Excel ingestion
pip install "nlqueries-core[wiki]" # Notion / Confluence syncPostgreSQL and SQLite need no extra. The generic sqlalchemy connector needs
whichever driver its URL names.
Option C — Clone and install from source
No Docker required — for contributing, or to run against unreleased changes:
git clone https://github.com/nlqueries/nlqueries.git
cd nlqueries
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\Activate.ps1
pip install -e ".[dev]"
export ANTHROPIC_API_KEY=sk-ant-... # or OPENAI_API_KEY
nlqueries healthSee CONTRIBUTING.md for linting and test commands.
First query
nlqueries connect postgres --host localhost --database mydb --user alice --password secret --alias dev
nlqueries process-history dev --days 30 --annotate
nlqueries export-kb dev
nlqueries query dev "How many orders shipped last month?"
nlqueries query dev "and how many were returned?" # follow-up — keeps prior contextFollow-up context is on by default; pass --new-session to start fresh or
--no-session to disable it for a one-off question.
Full walkthrough: docs/getting-started.md (or read online).
Documentation
Doc | Covers |
Step-by-step setup and your first query | |
Every command and flag | |
Database and document connector setup, per-connector notes and caveats | |
Environment variables | |
Common warnings and errors explained | |
Setting up Qdrant (required for embeddings, semantic cache, document search) | |
Authenticating the MCP server — required to serve it over a network | |
Module layout and request flow | |
The read-only role to grant per engine, and exactly what each connector does and does not enforce | |
The hashed lock file the image builds from, the digest-pinned base image, and how to regenerate both | |
What a new connector has to implement, and what to open an issue about first |
Contributing
See CONTRIBUTING.md. All contributors must sign the CLA before a PR can be merged — see CONTRIBUTOR_LICENSE_AGREEMENT.md.
License
Business Source License 1.1 — converting to Apache 2.0 no later than June 4, 2030. The licence sets that date and also converts each version on the fourth anniversary of its own first publication, whichever comes first, so a version first published before June 4, 2026 converts on its own anniversary, ahead of the fixed date.
Until then the licence grants production use, including commercially and self-hosted, with one carve-out: you may not offer NLQueries Core to third parties as a hosted or managed service. Individual and non-commercial self-hosted deployments are unrestricted. LICENSE is the authority; this paragraph is a summary.
Available Tools
9 toolsget_agent_schemaA
Return the schema for an agent: tables, columns, types, and foreign keys.
Reads the agent's YAML knowledge base and formats it compactly so you can
inspect exactly which tables and columns are available before formulating
a question.
Args:
agent_id: Agent ID from list_agents().
Returns:
Formatted schema string, or an error message if the agent is not found.
| Name | Required | Description | Default |
|---|---|---|---|
| agent_id | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It explains the tool reads the YAML knowledge base and returns a formatted string or error, but lacks details on side effects, rate limits, or security implications.
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, with a clear header and structured args/returns section. Every sentence adds value, though the args section could be more compact.
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 presence of an output schema, the description adequately explains the return value (formatted schema string or error). It covers the tool's purpose and input, though additional behavioral details could improve completeness.
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?
The single parameter 'agent_id' is described with origin ('from list_agents()'), adding context beyond the schema's type and title. Schema coverage is 0%, so the description compensates well.
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 clearly states the tool returns the schema for an agent (tables, columns, types, foreign keys). The verb 'return' and specific resource differentiate it from siblings like list_agents or query.
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 implies using the tool before formulating a question to inspect available tables/columns. It provides context but does not explicitly state when not to use or name alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_cache_statsA
Return cache statistics for an agent.
Reports the number of cached entries and the Qdrant collection name
used for this agent's semantic cache.
Args:
agent_id: Agent to inspect.
Returns:
Formatted stats string.
| Name | Required | Description | Default |
|---|---|---|---|
| agent_id | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must disclose behavioral traits. It states the tool returns a formatted stats string, implying a read-only operation. However, it does not detail error behavior (e.g., missing agent_id), permissions, or side effects. The mention of Qdrant collection adds some context but leaves gaps.
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 with two sentences and a structured Args/Returns list. Every sentence adds value with no redundancy or filler.
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 simplicity (one parameter, straightforward return), the description covers the essential information. It mentions what stats are reported and the return format. The presence of an output schema reduces the need for extensive return details. Minor omission: no mention of what happens if the agent has no cache.
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 0%, so the description must compensate. It explains 'agent_id: Agent to inspect', which clearly defines the parameter's purpose. For a single, simple string parameter, this is sufficient and adds value beyond the 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 begins with a specific verb-resource pair ('Return cache statistics for an agent'), clearly stating the tool's function. It further specifies the exact data reported (number of cached entries, Qdrant collection name). This distinguishes it from sibling tools like get_agent_schema or invalidate_cache.
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 implies usage for inspecting an agent's cache stats but provides no explicit guidance on when to use it versus alternatives or when not to use it (e.g., if cache is empty). No prerequisites or exclusions are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_query_historyA
Return recent queries and their feedback ratings for an agent.
Args:
agent_id: Agent to look up.
limit: Maximum number of records to return (default: 20, max: 200).
Returns:
Formatted history string, newest first.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| agent_id | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so the description carries the full burden. It mentions returning a 'formatted history string, newest first' but does not disclose whether the tool is read-only, has side effects, requires specific permissions, or handles errors. This is minimal behavioral insight.
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 (about 60 words) and well-structured with 'Args' and 'Returns' sections. Every sentence adds value; no fluff.
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 simplicity and presence of an output schema, the description explains the return format and ordering. It could mention behavior on empty results or errors, but overall it's fairly complete for a retrieval tool.
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 0% (no descriptions in schema), so the description must add meaning. It defines 'agent_id' as 'Agent to look up' and 'limit' with default and maximum values. This adds significant value beyond the bare schema types.
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 clearly states the tool returns 'recent queries and their feedback ratings for an agent'. It specifies the resource (query history) and the action (return). The sibling tools like 'submit_feedback' and 'query' are distinct, so no confusion.
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 provides basic arguments and returns but does not explicitly state when to use this tool versus alternatives. It implies usage for a specific agent but lacks exclusionary guidance or context on when not to use it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
healthA
Check connectivity to all NLQueries dependencies.
Runs four checks in sequence:
- LLM: sends a minimal completion request to verify the API key and model.
- Qdrant: hits the /healthz endpoint.
- Embed daemon: probes the local embedding server.
- Config: verifies KB_PATH exists and required env vars are set.
Returns:
A formatted status report string.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description fully discloses behavior: runs four checks in sequence, each described (LLM, Qdrant, Embed daemon, Config), and states it returns a formatted status report string. No contradictions.
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?
Description is concise: one-line summary, numbered list of checks, and return value. Front-loaded and well-structured with no wasted words.
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 simple tool with no parameters and an output schema, the description covers purpose, behavior (all checks), and output format completely. No gaps.
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?
No parameters exist, so baseline is 4. The description adds no parameter info as none needed.
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?
Description clearly states it checks connectivity to all NLQueries dependencies, listing four specific checks. It uses a specific verb 'check' and resource, and distinguishes from sibling tools which serve different purposes (e.g., query, cache management).
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?
Description implicitly tells when to use the tool (to verify connectivity) and provides clear context through the listed checks. However, it does not explicitly state when not to use it or compare to alternatives, though the unique health-check function makes this clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
invalidate_cacheA
Drop the entire semantic cache for an agent.
Use this after a schema change or data refresh to force fresh SQL
generation on the next query. The cache is rebuilt automatically
as new queries arrive.
Args:
agent_id: Agent whose cache should be cleared.
Returns:
Confirmation string.
| Name | Required | Description | Default |
|---|---|---|---|
| agent_id | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden. It states the effect ('Drop the entire semantic cache') and that the cache is rebuilt automatically. It also mentions the return type (confirmation string). It does not cover permission requirements or irreversibility, but is sufficient given the tool's simplicity.
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 (5 short sentences including structured Args/Returns) and front-loads the main action. The Args/Returns section is slightly redundant but acceptable.
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 simplicity (one parameter, no nested objects, no output schema), the description covers all necessary aspects: action, usage context, behavior, parameter meaning, and return type. It is complete for an agent to correctly invoke the tool.
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 0% for agent_id, but the description adds 'Agent whose cache should be cleared.' This fully explains the parameter's purpose, compensating for the lack of schema description.
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 clearly states the tool's purpose: 'Drop the entire semantic cache for an agent.' It uses a specific verb and resource, and distinguishes itself from sibling tools like get_cache_stats and get_query_history which are read-only.
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 explicitly says when to use: 'Use this after a schema change or data refresh to force fresh SQL generation.' It implies when not to use (only when invalidation is needed), but does not mention alternatives. However, no alternative tool exists for invalidation.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_agentsA
Return the IDs of all agents available on this NLQueries installation.
An agent is available when its YAML knowledge-base file exists in KB_PATH
(default: ~/.nlqueries/knowledge_base/). Run ``nlqueries export-kb`` to
create an agent from a registered connector.
Returns:
Sorted list of agent ID strings, e.g. ["sales", "support"].
Empty list when no agents have been exported yet.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. It discloses return format (sorted list of strings), example, empty list case, and underlying mechanism (YAML files, KB_PATH). This fully informs the agent of behavior.
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?
Description is concise, using two short paragraphs. First sentence front-loads the main purpose. Each subsequent sentence adds necessary detail without 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?
Given no parameters and presence of output schema (confirmed by context signals), description covers return type, example, edge case (empty list), and contextual background about agent availability. It is fully complete.
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?
No parameters exist (0 required). Schema coverage is 100% (empty properties). Baseline score of 4 applies since description needs no additional param info.
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?
Description clearly states the tool returns IDs of all available agents, with a specific verb 'Return' and resource 'IDs of all agents'. It distinguishes from siblings like 'get_agent_schema' and 'list_connectors' by focusing on agent listing.
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?
Description explains when agents are available (YAML file exists in KB_PATH) and how to create one ('nlqueries export-kb'). It provides clear context for usage but does not explicitly mention when not to use this tool or compare to alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_connectorsA
List registered database connectors and their types.
Returns connectors registered via ``nlqueries connect``. Passwords and
full connection URLs are redacted for safety.
Returns:
Formatted list of connector IDs and their db-types, or a message
when no connectors are registered.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Discloses important behavioral trait: passwords and full URLs are redacted for safety. Also mentions return format. No annotations exist, so description carries the burden adequately.
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?
Very concise, front-loaded with main action. Returns section adds value without redundancy. Every sentence 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 zero parameters and an output schema, the description provides sufficient context about purpose, behavior, and return format. No gaps for simple listing tool.
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?
No parameters in schema, so baseline is 4. Description adds no parameter info (unnecessary). Schema coverage is 100%.
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?
Clearly states it lists registered database connectors and their types, with specific verb 'List' and resource 'connectors'. Differentiates from siblings like list_agents or get_query_history.
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?
Implies usage for seeing registered connectors, but lacks explicit when-to-use, when-not-to-use, or alternatives. Sibling differentiation is implicit via distinct names.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
queryA
Ask a natural-language question to an NLQueries agent.
The agent translates the question into SQL (or searches indexed documents),
and returns a natural-language answer together with the generated SQL and
any source citations.
Args:
question: The natural-language question, e.g. "Total revenue by region
last quarter?"
agent_id: Agent to query — use list_agents() to discover available IDs.
dialect: SQL dialect for the target database (default: postgres).
Other supported values: snowflake, bigquery, redshift,
mysql, mssql, duckdb.
Returns:
Formatted string containing the natural-language answer, generated SQL
(for SQL/hybrid agents), and source citations (for document/hybrid agents).
Includes per-query latency and agent-type metadata.
| Name | Required | Description | Default |
|---|---|---|---|
| dialect | No | postgres | |
| agent_id | Yes | ||
| question | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. Discloses that the tool translates question to SQL or searches documents, and returns a formatted answer with SQL, citations, and metadata. Does not mention side effects, but likely read-only.
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?
Well-structured with purpose statement, detailed explanation, Args section, and Returns section. Front-loaded and every sentence adds value.
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?
Complete for a query tool with 3 parameters. Describes return format, mentions sibling tool list_agents for discovery, and covers all necessary behavioral aspects.
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?
Despite 0% schema description coverage, the description explains all three parameters in detail: question (natural-language question), agent_id (with reference to list_agents), and dialect (default and supported values). Adds significant meaning beyond 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?
Description clearly states the tool asks a natural-language question to an NLQueries agent. It specifies the verb 'ask' and the resource, and distinguishes from sibling tools like list_agents or health.
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?
Provides clear context for using the tool: translate question to SQL or search documents. Suggests using list_agents() to discover agent_ids. Lacks explicit when-not-to-use or alternatives, but context is strong.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
submit_feedbackA
Record user feedback for a query result.
Feedback is stored in ~/.nlqueries/feedback/<agent_id>.jsonl and is used
by ``nlqueries promote-feedback`` to improve future query accuracy by
seeding verified (question, SQL) examples into retrieval.
Args:
question: The question that was asked.
agent_id: The agent that answered it.
generated_sql: The SQL that was generated (copy from the query result).
rating: ``"up"`` (correct answer) or ``"down"`` (wrong answer).
corrected_sql: Optional corrected SQL when rating is ``"down"``.
Returns:
Confirmation string, or an error message.
| Name | Required | Description | Default |
|---|---|---|---|
| rating | Yes | ||
| agent_id | Yes | ||
| question | Yes | ||
| corrected_sql | No | ||
| generated_sql | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description covers file storage location, usage for accuracy improvement, and return value. It could mention side effects like overwriting or permissions, but overall good.
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 well-structured with bullet points, front-loaded with purpose. Every sentence adds value, though slightly lengthy. Could be more concise without losing clarity.
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 no output schema details, the description explains return type and ties the tool into a larger workflow. Could mention error handling or when corrected_sql is required, but adequate overall.
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 0%, but the description provides clear meanings for each parameter, including valid values for rating and optionality of corrected_sql, adding significant value beyond the 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 clearly states the verb 'Record' and the resource 'user feedback for a query result'. It distinguishes from siblings by focusing on feedback, while siblings handle queries, cache, etc.
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 implies when to use (after a query result) and explains the feedback's purpose. It lacks explicit exclusions or comparisons to alternatives, but the context makes it clear.
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.
9 tool updates
v0.1.0- First observed
get_agent_schema - First observed
get_cache_stats - First observed
get_query_history - First observed
health - First observed
invalidate_cache - First observed
list_agents - First observed
list_connectors - First observed
query - First observed
submit_feedback
TDQS
Scored across 9 tools
Each tool targets a distinct function: querying, schema inspection, agent listing, feedback, cache management, history, connectors, and health checks. No two tools overlap in purpose, so an agent can reliably select the correct one.
Most tools follow a consistent verb_noun pattern (get_agent_schema, list_agents, invalidate_cache, submit_feedback). The only deviation is 'health', which is a noun rather than a verb-action like 'check_health', but the overall naming is predictable and readable.
With 9 tools, the surface is well-scoped for an NLQ system. Each tool serves a clear operational need—discovery, querying, feedback, cache maintenance, and diagnostics—without bloat or redundancy.
The toolset covers the full agent workflow: list agents, inspect schemas, query, record feedback, review history, and manage the semantic cache. Connector listing and health checks round out operational needs, leaving no major gaps for the server's stated purpose.
Maintenance
Related MCP Connectors
Query your warehouse or a CSV with Claude/ChatGPT over MCP, governed by table-level ACL + audit.
Ask data questions in natural language. Get SQL, insights, and charts from your databases.
Query your org's data in natural language — read-only MCP access to SQL, NoSQL, files & warehouses.
Analytical memory for AI agents: a real Postgres queried in plain English over MCP. One command.
Related MCP Servers
- FlicenseNot gradedqualityFmaintenanceA production-ready MCP server that transforms natural language into safe, executable SQL queries with multi-database support and intelligent schema analysis.1-
- AlicenseNot gradedqualityDmaintenanceA unified MCP server for querying and managing multiple database types (PostgreSQL, MySQL, SQL Server, etc.) via natural language through AI assistants.GPL 3.0
- AlicenseNot gradedqualityDmaintenanceMCP server for SQL analytics on DuckDB and MotherDuck databases, enabling AI assistants and IDEs to query data via natural language.1MIT

Atlas MCPofficial
AlicenseNot gradedqualityAmaintenanceEnables natural language querying of SQL databases and REST APIs through the MCP protocol, grounded in a semantic layer.1,858 npm1AGPL 3.0