Skip to main content
Glama
nlqueries

NLQueries

Official
by nlqueries

nlqueries-core

CI PyPI Python License: BSL 1.1 Visitors

NLQueries Core is an open-source natural language to SQL engine — see nlqueries.com. It turns plain-English questions into validated SQL, builds a YAML knowledge base from your schema and query history (rebuilt whenever you re-run export-kb), and exposes everything as an MCP server your AI assistant can call directly. It also answers questions from your documents (PDF, Word, Excel, Markdown, plain text, Notion, Confluence), with citations.


Related MCP server: Legion Database MCP Server

Features

Capability

Description

Database connectors

PostgreSQL, Snowflake, BigQuery, Redshift, SQL Server / Azure SQL, DuckDB, SQLite — plus a generic SQLAlchemy connector, driven by a connection URL, for MySQL (connect mysql) and any other SQLAlchemy-reachable database

Document connectors

PDF, Word, Excel, Markdown, plain text, Notion, Confluence — ask questions over ingested documents with citations

Query pipeline

Filter, cluster, and parameterize query history into reusable QueryCapsule templates

Knowledge base

Auto-generated YAML schema + capsule file, with coverage reporting via kb-stats

Document Q&A

doc-ingest (or doc-sync-notion / doc-sync-confluence) chunks, embeds and stores a source in Qdrant; doc-ask answers from it with citations

Conversational follow-ups

Carries context across questions so a follow-up like "and by region?" resolves against the previous query — on by default in nlqueries query, reset with --new-session

Semantic cache

Recognises a question query or the MCP query tool has answered before, by meaning, and skips the LLM: it replays the stored answer and runs the stored SQL again so the rows are current (not with --no-execute). ask does not use it. Needs Qdrant

Embedding daemon

Keeps the embedding model resident in memory — ~10 ms per call instead of ~9 s

Feedback loop

Rate an answer with feedback, review with feedback-stats, and promote-feedback the thumbs-up ones — their SQL is re-validated against the current schema and blended into later prompts as verified examples

Regression checks

eval re-asks the agent's own mined capsules — and a golden question set too, with --golden — then checks the generated SQL parses and references only tables the agent knows

dbt import

import-dbt merges dbt model and column descriptions into the knowledge base

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

nlqueries (or the shorter nlq alias) — connect, build, query, and inspect from your terminal

See docs/architecture.md (or read online) for how these pieces fit together.


Quickstart

Prerequisite: Python 3.11–3.14.

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.yml

Create a .env file next to it with one LLM key, a Qdrant key and an MCP token. All three are required — compose refuses to start without QDRANT_API_KEY or NLQ_MCP_STATIC_TOKEN:

ANTHROPIC_API_KEY=sk-ant-...
# or OPENAI_API_KEY=sk-...
QDRANT_API_KEY=...         # any random secret: openssl rand -hex 32
NLQ_MCP_STATIC_TOKEN=...   # another one: openssl rand -hex 32

The MCP server is reachable over the network, so it requires that token: an MCP client connects to http://localhost:8080/sse and sends Authorization: Bearer <your NLQ_MCP_STATIC_TOKEN>. The token has full access. To give different people different access, see docs/mcp-authentication.md.

Then start the stack:

docker compose up

This pulls nlqueries/core:0.3.0 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 health

The image includes the PostgreSQL, SQLite, Snowflake, BigQuery and DuckDB drivers. It does not include the MySQL, Redshift or SQL Server drivers, or the docs and wiki extras (PDF / Word / Excel ingestion, Notion / Confluence sync); for those, install with pip (Option B) and add the extra.

Option B — pip install

pip install nlqueries-core
export ANTHROPIC_API_KEY=sk-ant-...   # or OPENAI_API_KEY
nlqueries health

Optional extras for specific connectors:

pip install "nlqueries-core[mysql]"      # MySQL (driver for the generic connector)
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 sync

PostgreSQL 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 health

See 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 context

Follow-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

docs/getting-started.md (or read online)

Step-by-step setup and your first query

docs/cli-reference.md (or read online)

Every command and flag

docs/connectors.md (or read online)

Database and document connector setup, per-connector notes and caveats

docs/configuration.md (or read online)

Environment variables

docs/troubleshooting.md (or read online)

Common warnings and errors explained

docs/qdrant-setup.md (or read online)

Setting up Qdrant (required for embeddings, semantic cache, document search)

docs/mcp-authentication.md (or read online)

Authenticating the MCP server — required to serve it over a network

docs/architecture.md (or read online)

Module layout and request flow

docs/database-hardening.md (or read online)

The read-only role to grant per engine, and exactly what each connector does and does not enforce

docs/dependency-locking.md (or read online)

The hashed lock file the image builds from, the digest-pinned base image, and how to regenerate both

docs/contributing.md (or read online)

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 tools
get_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 which tables and columns are available before formulating a
question. A table whose column list is partial carries a note saying so.

Args:
    agent_id: Agent ID from list_agents().

Returns:
    Formatted schema string, or an error message if the agent is not found.
ParametersJSON Schema
NameRequiredDescriptionDefault
agent_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden and does well: it discloses the underlying source (the agent's YAML knowledge base), that output is compactly formatted, that partial column lists are annotated as such, and that a not-found agent yields an error message. It omits only secondary traits like auth requirements or rate limits, which is a minor gap for a read-only lookup.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core purpose in sentence one, followed by operational context and a compact Args/Returns block. The Returns section partly restates what the output schema already encodes, which is mild redundancy, but nothing is padded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter read tool with an output schema present, the description covers everything an agent needs: what is fetched, why, the partial-column caveat, and the failure mode. Return-value detail is already in the output schema, so no essential information is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate and largely does: 'agent_id: Agent ID from list_agents()' tells the agent both the meaning and the upstream call that supplies the value. It does not specify the ID format or an example value, leaving a small residual gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Return the schema for an agent') and enumerates exactly what is returned: tables, columns, types, foreign keys. This cleanly separates it from siblings like list_agents (enumeration) and query (execution), so an agent can pick 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.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives a clear situational cue: inspect available tables and columns 'before formulating a question,' which positions it as a pre-step to query. It stops short of naming exclusions or an explicit alternative (e.g., when to skip it because list_agents already suffices), so it falls just short of a 5.

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.
ParametersJSON Schema
NameRequiredDescriptionDefault
agent_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.
ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
agent_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.8/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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: reports the configured provider and model. Sends a real completion
  only when *probe_llm* is true.
- Qdrant: hits the /healthz endpoint.
- Embed daemon: probes the local embedding server.
- Config: verifies KB_PATH exists and required env vars are set.

Args:
    probe_llm: Spend a token on a live round-trip to the model. Off by
        default: this tool is reachable without credentials, and a health
        check that costs money is a way to bill someone for asking whether
        their server is up. Off, the LLM line reports configuration; on, it
        reports latency and a working key.

Returns:
    A formatted status report string.
ParametersJSON Schema
NameRequiredDescriptionDefault
probe_llmNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does so well: it discloses that the tool is reachable without credentials, that probe_llm defaults to false, that enabling it spends a real token and returns latency plus a key check, and that the other three checks are non-destructive endpoint probes. This is exactly the cost/auth/default context an agent needs before invoking.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the one-line purpose, then a scannable bulleted list of checks, then Args/Returns — a good structure. It is slightly padded by the editorial aside about billing someone for asking whether their server is up, which costs a sentence without adding call-relevant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists so return formatting needn't be explained, and the description still states it returns a formatted status report string. Every dependency checked, the cost tradeoff, the default, and the credential-free access are all covered — nothing an agent needs to call this correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% and the single parameter's schema entry is only a title and default, so the description must compensate — and it does, explaining precisely what probe_llm does on and off (configuration line vs. live round-trip with latency and key validation) plus its cost implication and default.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb+resource ("Check connectivity to all NLQueries dependencies") and then enumerates the four checks, so an agent knows exactly what the tool reports on. It is clearly distinguishable from siblings like query, list_connectors, or invalidate_cache, none of which are diagnostics.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The framing as a connectivity/dependency check makes the use case obvious, and the per-check breakdown tells the agent what a call will actually exercise. It stops short of naming when not to use it or which sibling to prefer for related diagnostics, so it is clear context rather than explicit routing.

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.
ParametersJSON Schema
NameRequiredDescriptionDefault
agent_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.5/5.0
Behavior4/5

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.

Conciseness4/5

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.

Completeness5/5

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.

Parameters5/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.
ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.7/5.0
Behavior5/5

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.

Conciseness5/5

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.

Completeness5/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.
ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness5/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.
    explain:   When true, append an answer-provenance summary (route,
               cache hit/miss, knowledge injected, checks, timings).
    paraphrase: When true, append a deterministic plain-English rendering of
               the generated SQL (no LLM), so you can confirm what it does.

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.
ParametersJSON Schema
NameRequiredDescriptionDefault
dialectNopostgres
explainNo
agent_idYes
questionYes
paraphraseNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does substantial work: it discloses that the agent may produce SQL or search documents, that explain appends route/cache/knowledge/check/timing provenance, and that paraphrase yields a deterministic non-LLM rendering of the SQL. It omits safety profile (read-only vs. arbitrary SQL execution), permission requirements, and rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action, then structured Args/Returns sections with no filler. Slightly long, but each line adds information an agent needs, particularly the dialect enumeration and the explain/paraphrase distinctions.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers purpose, all parameters, and behavioral nuances for a 5-param tool with no annotation coverage. Although an output schema exists (making the Returns section partly redundant), the description's extra detail about what the formatted string contains is consistent and complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, yet the description documents all five parameters: question with an example, agent_id with a discovery pointer, dialect with default and the full set of supported values, plus the semantics of explain and paraphrase. This fully compensates for the empty schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Ask a natural-language question to an NLQueries agent') and immediately clarifies the mechanism (SQL translation or indexed-document search). It is clearly distinguishable from siblings like get_query_history, list_agents, and health.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description points to list_agents() for discovering agent_id, which is useful routing guidance, but it never states when to prefer this tool over alternatives (e.g. get_query_history for past queries) or any exclusions/limits. Usage is implied rather than prescribed.

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.
ParametersJSON Schema
NameRequiredDescriptionDefault
ratingYes
agent_idYes
questionYes
corrected_sqlNo
generated_sqlYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.4/5.0
Behavior4/5

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.

Conciseness4/5

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.

Completeness4/5

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.

Parameters5/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.

  1. 2 tool updatesv0.3.0
    • Changedhealth1 field changed
      • addedInput schema / properties / probe_llm
        Added value: +{
        +  "default": false,
        +  "title": "Probe Llm",
        +  "type": "boolean"
        +}
    • Changedquery2 fields changed
      • addedInput schema / properties / explain
        Added value: +{
        +  "default": false,
        +  "title": "Explain",
        +  "type": "boolean"
        +}
      • addedInput schema / properties / paraphrase
        Added value: +{
        +  "default": false,
        +  "title": "Paraphrase",
        +  "type": "boolean"
        +}
  2. 9 tool updatesv0.1.0
    • First observedget_agent_schema
    • First observedget_cache_stats
    • First observedget_query_history
    • First observedhealth
    • First observedinvalidate_cache
    • First observedlist_agents
    • First observedlist_connectors
    • First observedquery
    • First observedsubmit_feedback

TDQS

A4.2/5.0

Scored across 9 tools

Disambiguation5/5

Each tool targets a clearly distinct action+resource: query runs a question, get_query_history retrieves past queries, invalidate_cache clears the cache, get_cache_stats reports on it. The cache pair (invalidate vs. stats) and the query pair (query vs. history) are unambiguous despite sharing a domain.

Naming Consistency4/5

Nearly all tools follow a clean verb_noun pattern (list_connectors, get_agent_schema, get_cache_stats, get_query_history, submit_feedback, invalidate_cache). The bare 'query' and 'health' break the pattern, but they are readable and the overall convention is stable.

Tool Count5/5

Nine tools is well-scoped for an NL-query server, covering agents, connectors, schema, querying, cache, history, feedback, and health without bloat. Each tool earns its place and none appear redundant.

Completeness4/5

The surface covers the full query lifecycle: discover agents/connectors, inspect schema, run queries, manage cache, view history, and submit feedback. Minor gaps exist (agent/connector creation is CLI-only, no delete/export tools), but core workflows have no dead ends.

Maintenance

ActivityActive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    F
    maintenance
    A production-ready MCP server that transforms natural language into safe, executable SQL queries with multi-database support and intelligent schema analysis.
    1
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    A unified MCP server for querying and managing multiple database types (PostgreSQL, MySQL, SQL Server, etc.) via natural language through AI assistants.
    GPL 3.0
  • A
    license
    Not graded
    quality
    D
    maintenance
    MCP server for SQL analytics on DuckDB and MotherDuck databases, enabling AI assistants and IDEs to query data via natural language.
    1
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables natural language querying of SQL databases and REST APIs through the MCP protocol, grounded in a semantic layer.
    649 npm
    1
    AGPL 3.0