Skip to main content
Glama
andyWang1688

sql-query-mcp

by andyWang1688

sql-query-mcp

中文版

A general-purpose MCP server that lets AI work with multiple databases within clear boundaries.

sql-query-mcp MCP server

Current database support

Database

Status

Current availability

PostgreSQL

Supported

Available today

MySQL

Supported

Available today

Hive

Supported

Available today

SQLite

Candidate

Not supported yet

SQL Server

Candidate

Not supported yet

ClickHouse

Candidate

Not supported yet

Related MCP server: DiceDB MCP

Product value

sql-query-mcp helps AI clients discover schema, sample data, and analyze read-only queries through one controlled MCP interface.

It keeps connection handling, namespace rules, SQL validation, and audit logging on the server side, so you can expose useful database context to AI without exposing raw connection strings or flattening engine-specific concepts.

What AI can do with it

The current tool set focuses on database discovery, controlled query workflows, asynchronous read-only queries, batched query result exports, and one narrow local file import path. You can use it to help an AI assistant understand structure before it generates SQL, runs a bounded query, starts a long-running read-only query, exports PostgreSQL or MySQL results to a local file, or imports a prepared CSV/XLSX file into an existing table.

MySQL and Hive support explain_query. Hive uses EXPLAIN and EXPLAIN ANALYZE for explain_query.

Tool

PostgreSQL

MySQL

Hive

Purpose

list_connections()

Yes

Yes

Yes

List configured connections

list_schemas(connection_id)

Yes

No

No

List visible PostgreSQL schemas

list_databases(connection_id)

No

Yes

Yes

List visible MySQL or Hive databases

list_tables(connection_id, schema?, database?)

Yes

Yes

Yes

List tables and views

describe_table(connection_id, table_name, schema?, database?)

Yes

Yes

Yes

Inspect columns, keys, and indexes

run_select(connection_id, sql, limit?)

Yes

Yes

Yes

Run short bounded read-only queries

start_query(connection_id, sql, limit?)

Yes

Yes

Yes

Start long-running read-only queries

get_query(query_id, offset?, limit?)

Yes

Yes

Yes

Fetch async query status and paginated results

cancel_query(query_id)

Yes

Yes

Yes

Cancel running async queries

explain_query(connection_id, sql, analyze?)

Yes

Yes

Yes

Inspect query plans

get_table_sample(connection_id, table_name, schema?, database?, limit?)

Yes

Yes

Yes

Fetch small table samples

export_query_file(connection_id, sql, output_path, format?, limit?, export_all?, file_name?, overwrite?)

Yes

Yes

No

Export query results to local CSV/XLSX files

import_table_file(connection_id, table_name, file_path, schema?, database?, sheet_name?)

Yes

Yes

Yes

Import local CSV/XLSX files

These tools are useful for tasks such as listing namespaces, inspecting table definitions, reviewing indexes, sampling records, running short read-only queries with run_select, running long read-only queries with start_query, get_query, and cancel_query, analyzing read-only queries with EXPLAIN, and exporting PostgreSQL or MySQL query results to local CSV/XLSX files. You can also import prepared local files. For full request and response details, see docs/api-reference.md (Chinese).

How boundaries are constrained

The product boundary is intentionally narrow today. PostgreSQL, MySQL, and Hive are available today. Query tools remain read-only, PostgreSQL and MySQL query results can be exported to local files, and the only database write path is a controlled local CSV/XLSX import into existing tables.

The service keeps those boundaries explicit in a few ways.

  • Connections declare engine explicitly, so the server never guesses from connection_id.

  • PostgreSQL uses schema, while MySQL and Hive use database, without collapsing both into one vague namespace field.

  • Real DSNs stay in environment variables, while config files store only the environment variable names.

  • Query execution passes through sqlglot validation before reaching the database. Use run_select for short bounded read-only queries, and use start_query, get_query, and cancel_query for long-running read-only queries.

  • The server accepts only SELECT and WITH ... SELECT, rejects comments and multi-statement input, and records audit logs for each call.

  • export_query_file writes files on the MCP server machine. It is synchronous but reads database rows and writes CSV/XLSX files in batches. Large exports can still hit your MCP client's tool timeout. For XLSX output, UUID values are written as text and timezone-aware datetime values are written without the timezone. Hive export is not supported yet.

  • import_table_file doesn't accept raw SQL. It inserts only file columns whose headers exactly match existing table columns.

  • Hive import_table_file is intended for small files only and rejects files with more than 1000 data rows. Hive imports write rows one by one, so they can be slow and can hit your MCP client's tool timeout. For bulk Hive loads, use Hive-native LOAD DATA, external tables, or your existing data ingestion pipeline.

For Hive, explain_query uses EXPLAIN and EXPLAIN ANALYZE.

Quick start

sql-query-mcp supports two official PyPI-based setup modes. Both are intended for real usage, not just local testing.

  1. Choose how you want your MCP client to start the server.

Use installed command mode if you want a simple local command after one install.

pipx install sql-query-mcp

Use managed launch mode if you want the package source declared directly in your MCP client config.

pipx run --spec sql-query-mcp sql-query-mcp

Pin a version with pipx install 'sql-query-mcp==X.Y.Z' or pipx run --spec 'sql-query-mcp==X.Y.Z' sql-query-mcp. Upgrade installed command mode with pipx upgrade sql-query-mcp.

  1. Create a config file.

The server configuration should live outside the repository so the same file works with either startup mode.

mkdir -p ~/.config/sql-query-mcp

Then save the example JSON later in this section as ~/.config/sql-query-mcp/connections.json.

  1. Register the server in your MCP client.

  • Codex: docs/codex-setup.md (Chinese)

  • OpenCode: docs/opencode-setup.md (Chinese)

Installed command mode means your client runs sql-query-mcp directly. Managed launch mode means your client starts the server through pipx run.

In both modes, put SQL_QUERY_MCP_CONFIG and your real database DSNs in the MCP client's environment block instead of exporting them in your shell.

The console entry point is sql-query-mcp, which maps to sql_query_mcp.app:main.

The PyPI install name is sql-query-mcp, and the Python package import path is sql_query_mcp.

For pipx install and pipx run, set SQL_QUERY_MCP_CONFIG explicitly to your config file path. The default config/connections.json path is mainly for source checkouts and local development.

The example config looks like this.

{
  "settings": {
    "default_limit": 200,
    "max_limit": 1000,
    "audit_log_path": "logs/audit.jsonl"
  },
  "connections": [
    {
      "connection_id": "crm_prod_main_ro",
      "engine": "postgres",
      "label": "CRM PostgreSQL production / Main / read-only",
      "env": "prod",
      "tenant": "main",
      "role": "ro",
      "dsn_env": "PG_CONN_CRM_PROD_MAIN_RO",
      "enabled": true,
      "default_schema": "public"
    },
    {
      "connection_id": "crm_mysql_prod_main_ro",
      "engine": "mysql",
      "label": "CRM MySQL production / Main / read-only",
      "env": "prod",
      "tenant": "main",
      "role": "ro",
      "dsn_env": "MYSQL_CONN_CRM_PROD_MAIN_RO",
      "enabled": true,
      "default_database": "crm"
    },
    {
      "connection_id": "warehouse_hive_prod_main_ro",
      "engine": "hive",
      "label": "Warehouse Hive production / Main / read-only",
      "env": "prod",
      "tenant": "main",
      "role": "ro",
      "dsn_env": "HIVE_CONN_WAREHOUSE_PROD_MAIN_RO",
      "enabled": true,
      "default_database": "default"
    }
  ]
}

Set DSNs in the MCP client environment. For Hive, use a Hive DSN such as:

export HIVE_CONN_WAREHOUSE_PROD_MAIN_RO='hive://user:password@hive.example.com:10000/default?auth=CUSTOM'

Documentation

If you want implementation details, setup guidance, or internal structure, use these docs as your starting points.

  • docs/project-overview.md: project goals, concepts, and code structure (Chinese)

  • docs/api-reference.md: MCP tool reference (Chinese)

  • docs/codex-setup.md: Codex setup steps (Chinese)

  • docs/opencode-setup.md: OpenCode setup steps (Chinese)

  • docs/release-process.md: PyPI and GitHub Release workflow (Chinese)

  • docs/git-workflow.md: repository collaboration workflow (Chinese)

Development

If you want to modify or verify the project locally, use this shortest path. Editable install remains the development path, and the local environment still requires Python 3.10+.

python3.10 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install -e .
PYTHONPATH=. python3 -m unittest discover -s tests

The main entry point is sql_query_mcp/app.py. Core modules include:

  • sql_query_mcp/config.py: config loading and validation

  • sql_query_mcp/validator.py: read-only SQL validation

  • sql_query_mcp/introspection.py: metadata inspection

  • sql_query_mcp/executor.py: query execution and limits

  • sql_query_mcp/adapters/: PostgreSQL, MySQL, and Hive adapters

Contributing

If you want to contribute or review the repository workflow, start with these pages.

  • CONTRIBUTING.md

  • docs/roadmap.md

  • docs/git-workflow.md (Chinese)

Run PYTHONPATH=. python3 -m unittest discover -s tests before you submit changes.

License

This project is released under the MIT License. See LICENSE.

Available Tools

13 tools
cancel_queryB

Cancel a running asynchronous query.

ParametersJSON Schema
NameRequiredDescriptionDefault
query_idYes

TDQS

B3.4/5.0
Behavior2/5

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

Description lacks details on side effects, permissions, idempotency, or error handling. No annotations provided to compensate.

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?

Single sentence, no redundant words, effectively communicates core action.

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

Completeness3/5

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

Adequate for a simple cancel operation, but missing information on edge cases like non-existent or already completed queries.

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

Parameters2/5

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

Parameter 'query_id' is self-explanatory but description does not clarify its origin or format, adding no value beyond the schema title.

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 verb 'Cancel' and resource 'running asynchronous query', distinguishing it from sibling tools like start_query and get_query.

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?

No explicit guidance on when to use or alternatives, but the context of sibling tools implies it is for cancelling queries started by start_query or run_select.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

describe_tableB

Describe columns, keys, and indexes for a table.

ParametersJSON Schema
NameRequiredDescriptionDefault
schemaNo
databaseNo
table_nameYes
connection_idYes

TDQS

B3.1/5.0
Behavior3/5

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

No annotations are present, so the description carries full burden. It implies a read-only metadata retrieval but does not explicitly state safety, permissions, or rate limits. While 'describe' suggests non-destructive, the lack of explicit transparency justifies a moderate score.

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

Conciseness3/5

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

The description is a single 7-word sentence, which is concise but under-specified. It front-loads the purpose but omits necessary context for parameters and usage. It could be expanded without losing conciseness.

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

Completeness2/5

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

With 4 parameters (2 required), no output schema, and no annotations, the description is too brief to be complete. It does not explain return values, parameter roles, or usage context, leaving significant gaps for an agent to properly invoke the tool.

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

Parameters2/5

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

Schema description coverage is 0% (no parameter descriptions). The description does not explain the meaning or usage of parameters like 'connection_id', 'table_name', 'schema', or 'database'. It fails to compensate for the schema gap, offering no parameter semantics.

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: describing columns, keys, and indexes for a table. It uses a specific verb 'describe' and resource 'table', which distinctively sets it apart from siblings like 'list_tables' (list tables) and 'get_table_sample' (fetch data).

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites (e.g., connection_id, table_name) or scenarios where it is inappropriate. No comparison with siblings like 'list_tables' or 'get_table_sample'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

explain_queryB

Run EXPLAIN on a read-only SELECT or CTE query.

ParametersJSON Schema
NameRequiredDescriptionDefault
sqlYes
analyzeNo
connection_idYes

TDQS

B3.4/5.0
Behavior3/5

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 states the tool is read-only and runs EXPLAIN, which is generally non-destructive. However, it does not detail permissions, side effects, or output format. This is minimally adequate but lacks depth.

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 a single, concise sentence with no redundant information. It directly communicates the tool's function.

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

Completeness1/5

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

Given no output schema, no annotations, and three parameters with zero description coverage, the description is extremely incomplete. It fails to provide essential details for agent usage, such as parameter meanings, output structure, or behavioral nuances.

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

Parameters1/5

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

Schema description coverage is 0%, and the tool description adds no parameter details. The three parameters (sql, analyze, connection_id) are not explained at all. Without additional context in the description, the agent cannot understand parameter semantics.

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 runs EXPLAIN on read-only SELECT or CTE queries. This distinguishes it from siblings like run_select (which executes the query) and describe_table (which describes tables). The verb 'Run EXPLAIN' and resource 'SELECT or CTE query' are specific.

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 specifies the queries are 'read-only SELECT or CTE', implying it should be used for analyzing query plans and not for DML queries. It clearly indicates the context but does not explicitly mention when not to use or list alternatives among siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

export_query_fileB

Export a read-only query result to a local CSV or XLSX file.

ParametersJSON Schema
NameRequiredDescriptionDefault
sqlYes
limitNo
formatNocsv
file_nameNo
overwriteNo
export_allNo
output_pathYes
connection_idYes

TDQS

B3/5.0
Behavior2/5

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

With no annotations, the description carries full burden. It only notes read-only, but fails to disclose side effects, file location, or behavior of parameters like overwrite and export_all. Important behaviors are omitted.

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 a single concise sentence that front-loads the core action. It is appropriately sized but could include more detail without becoming verbose.

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

Completeness2/5

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

Given 8 parameters, no output schema, and no annotations, the description is inadequate. It does not cover required parameters, output format details, or behavior nuances, leaving significant gaps.

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

Parameters1/5

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

Schema description coverage is 0%, so description must explain parameters. It only mentions CSV and XLSX (format), but ignores all other 7 parameters including required ones like SQL and connection_id. No additional meaning is provided.

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 exports a read-only query result to CSV or XLSX files. It uses a specific verb-resource pair and distinguishes from siblings like run_select and import_table_file.

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 it's for read-only operations but does not explicitly state when to use this tool over alternatives or when not to use it. No alternatives are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_queryB

Get asynchronous query status and paginated results when complete.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
offsetNo
query_idYes

TDQS

B3.3/5.0
Behavior2/5

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

With no annotations, the description bears full burden. It mentions async behavior and pagination but fails to disclose what happens if the query is still running, the format of status responses, or how to handle errors. Lacks details on polling 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?

The description is a single concise sentence with no wasted words. It efficiently communicates the core functionality.

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

Completeness2/5

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

The tool is moderately complex (async, paginated, status check) and has no output schema. The description is too brief to cover necessary context like how to poll for status, interpret results, or handle partial results. Leaves significant gaps.

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

Parameters2/5

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

Schema description coverage is 0%, so description must compensate. It adds minimal meaning by mentioning 'paginated results' which hints at limit/offset, but does not explain query_id or the behavior of limit/offset defaults. Leaves parameter semantics largely unexplained.

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 retrieves asynchronous query status and paginated results when complete, using specific verb and resource. It distinguishes from siblings like start_query and run_select by focusing on the retrieval of results.

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 the tool should be used after a query is complete, but provides no explicit when-to-use or when-not-to-use guidance. It does not name alternatives like cancel_query or explain_query.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_table_sampleC

Fetch a small sample from a table for schema discovery.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
schemaNo
databaseNo
table_nameYes
connection_idYes

TDQS

C2.6/5.0
Behavior2/5

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

With no annotations provided, the description must disclose behavioral traits. It mentions 'small sample' but does not specify the default limit, that it is read-only, or any authentication requirements. The lack of detail about the return behavior (e.g., row count, data format) leaves the agent uninformed.

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

Conciseness3/5

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

The description is very concise (one sentence) and front-loads the purpose. However, it is too brief to convey necessary detail, sacrificing completeness for brevity. It earns its place but could be expanded without becoming verbose.

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

Completeness1/5

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

Given the absence of annotations, output schema, and parameter descriptions, the description is severely incomplete. It does not explain what the return value looks like, how many rows are fetched, or any prerequisites (e.g., that the table must exist). The tool requires 5 parameters, but nothing is said about their roles or constraints.

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

Parameters1/5

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

Schema coverage is 0%, meaning no parameter descriptions are present in the input schema. The description does not add any meaning to parameters like connection_id, table_name, limit, schema, or database. It fails to explain what each parameter does, leaving the agent without context beyond the schema's basic types and defaults.

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: 'Fetch a small sample from a table for schema discovery.' It specifies the verb 'fetch' and the resource 'table sample', and the phrase 'for schema discovery' distinguishes it from siblings like run_select (generic querying) and describe_table (schema structure only).

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

Usage Guidelines2/5

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

The description does not provide any explicit guidance on when to use this tool versus alternatives like describe_table or run_select. The phrase 'for schema discovery' implies a specific use case, but no when-to-use or when-not-to-use instructions are given, leaving the agent without clear decision support.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

import_table_fileA

Import a local CSV or XLSX file into an existing table.

ParametersJSON Schema
NameRequiredDescriptionDefault
schemaNo
databaseNo
file_pathYes
sheet_nameNo
table_nameYes
connection_idYes

TDQS

A3.5/5.0
Behavior2/5

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

With no annotations provided, the description carries the full burden for behavioral disclosure. It does not mention whether data is appended or overwritten, permission requirements, file size limits, or other side effects. This is insufficient for a mutation tool.

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 a single sentence that efficiently conveys the core purpose. It is front-loaded and contains no redundant information.

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

Completeness2/5

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

Given 6 parameters (3 required), no output schema, and no parameter descriptions, the description is inadequate. It fails to cover file format specifics, behavior on conflict, or usage context for optional parameters.

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

Parameters2/5

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

The description mentions high-level purpose but does not explain any parameters beyond the tool's summary. With 0% schema description coverage, this leaves 6 parameters undocumented, providing minimal added value.

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 imports a local CSV or XLSX file into an existing table, specifying the action, resource, and target. It distinguishes from sibling tools like export_query_file and run_select.

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 the tool is for importing local files into an existing table, which differentiates it from querying, exporting, or describing tables. However, it lacks explicit guidance on prerequisites or 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.

list_connectionsB

List configured SQL connections by connection_id.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.3/5.0
Behavior3/5

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

Without annotations, the description carries the full burden. It indicates a read operation ('List') but does not disclose behavioral traits such as authentication needs, rate limits, or whether the list is exhaustive. The simplicity of the tool partially compensates for the lack of detail.

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 a single sentence with no superfluous words. It is appropriately sized for the tool's simplicity.

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

Completeness3/5

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

Given the low complexity (no parameters, no output schema), the description is minimally complete. It states what the tool does but lacks details about the output format or what constitutes a 'configured SQL connection'. It is adequate but could be slightly enhanced.

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

Parameters3/5

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

The input schema has no parameters and 100% coverage, so the description adds no additional meaning. The baseline of 3 is appropriate as the schema is self-sufficient.

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

Purpose4/5

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

The description clearly states 'List configured SQL connections by connection_id.' specifying the verb and resource. However, mentioning 'by connection_id' is slightly misleading as there are no input parameters; it might imply filtering. Still, it distinguishes itself from sibling list tools like list_databases and list_tables.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives like list_databases or list_schemas. The description does not mention prerequisites or context for listing connections.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_databasesB

List visible databases for a MySQL or Hive connection.

ParametersJSON Schema
NameRequiredDescriptionDefault
connection_idYes

TDQS

B3.2/5.0
Behavior2/5

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

Without annotations, the description carries full burden for behavioral disclosure. It only says 'list visible databases,' but does not mention whether it is read-only, auth requirements, or any side effects. This is minimal and insufficient for an agent to assess safety.

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 a single concise sentence (8 words) that is front-loaded with the action. However, it might be overly terse, missing details that could be included without harming conciseness.

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

Completeness2/5

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

Given no output schema and no annotations, the description should provide more context about inputs, outputs, and behavior. It lacks details on return format, prerequisites, or the concept of 'visible.' This is insufficient for complete understanding.

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

Parameters2/5

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

Schema coverage is 0%, so description must compensate. The description mentions 'for a MySQL or Hive connection,' adding context that connection_id refers to such a connection, but does not explain the parameter's meaning, format, or where to obtain it. This adds minimal value.

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 that the tool lists visible databases for a MySQL or Hive connection, giving a specific verb and resource. It implicitly differentiates from sibling tools like list_schemas or list_tables, which operate at different levels.

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 the tool should be used when you need to see databases for a specific connection, but it lacks explicit guidance on when not to use it or alternatives. No mention of prerequisites or comparison with siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_schemasB

List visible schemas for a PostgreSQL connection.

ParametersJSON Schema
NameRequiredDescriptionDefault
connection_idYes

TDQS

B3.1/5.0
Behavior2/5

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

No annotations are present, so the description must fully disclose behavioral traits. It only says 'list visible schemas' and omits other traits like mutability, safety, or permissions. This is insufficient for an agent to understand implications.

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 extremely concise at 6 words, which is efficient for a simple list tool. However, it lacks structure that could include parameter context or usage notes.

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

Completeness3/5

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

Given the simple nature of the tool and lack of output schema, the description provides minimal context about what the list contains or how filtering ('visible') works. It is adequate but not thorough for robust tool selection.

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

Parameters2/5

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

With 0% schema description coverage, the description should clarify the single required parameter connection_id. It only vaguely refers to 'a PostgreSQL connection' without adding meaning beyond the schema's name and type.

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 lists visible schemas for a PostgreSQL connection, which distinguishes it from siblings like list_tables and list_databases that list different objects.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives, nor any conditions or exclusions. The agent is left to infer usage context from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_tablesC

List tables and views for a resolved schema or database.

ParametersJSON Schema
NameRequiredDescriptionDefault
schemaNo
databaseNo
connection_idYes

TDQS

C2.7/5.0
Behavior2/5

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

Annotations are absent, so the description must carry the full behavioral burden. It only states the basic action, lacking details on permissions, output format, or what 'resolved' means.

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 a single concise sentence, but it could be slightly expanded to include key details without losing brevity.

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

Completeness2/5

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

Given the number of sibling tools and no output schema, the description is incomplete. It omits essential context like relationships to list_databases and list_schemas, or what 'resolved' signifies.

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

Parameters2/5

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

Schema description coverage is 0%, and the description adds no meaning beyond parameter names. There is no explanation of how schema and database interact or what 'resolved' implies.

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

Purpose4/5

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

The description clearly states it lists tables and views for a schema or database, specifying the verb and resource. However, it does not differentiate from sibling tools like list_databases or list_schemas, missing nuance like 'resolved.'

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives, no prerequisites mentioned, and no context on handling optional parameters.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

run_selectA

Run a read-only SELECT or CTE query.

ParametersJSON Schema
NameRequiredDescriptionDefault
sqlYes
limitNo
connection_idYes

TDQS

A3.6/5.0
Behavior3/5

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 discloses the read-only nature, which is critical for safety, but lacks further behavioral traits such as timeouts, response structure, or rate limits. A more detailed description would be beneficial.

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 a single sentence of 7 words, extremely concise and front-loaded with the key purpose. However, it could be slightly more informative without sacrificing conciseness.

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

Completeness2/5

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

Given no output schema, the description should explain what the tool returns (e.g., rows, columns, success indication). It also lacks information about error handling or prerequisites (e.g., connection must be live). This leaves the agent with incomplete context for using the tool reliably.

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

Parameters2/5

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

Schema description coverage is 0%, meaning no parameter descriptions exist in the schema. The description adds no additional meaning beyond the parameter names (sql, limit, connection_id). It does not explain the purpose of limit, the format of sql, or how connection_id is used.

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 runs a read-only SELECT or CTE query. It specifies the verb 'run', the resource 'query', and the scope 'read-only', effectively distinguishing it from sibling tools like start_query (presumably for writes) and other non-query tools.

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 indicates the tool is 'read-only', which guides the agent to use it only for queries that do not modify data. It implies when not to use (for DML operations), but does not name alternatives like start_query for writes or explain_query for analysis.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

start_queryB

Start an asynchronous read-only SELECT or CTE query.

ParametersJSON Schema
NameRequiredDescriptionDefault
sqlYes
limitNo
connection_idYes

TDQS

B3.1/5.0
Behavior3/5

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

With no annotations, the description carries the burden. It discloses key behaviors: async (needs follow-up), read-only (no writes), and restricted to SELECT/CTE. However, it omits how to monitor or cancel queries, and does not mention authentication or 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.

Conciseness5/5

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

Single sentence delivering essential information: verb, async, read-only, query type. No unnecessary words. Front-loaded with key differentiators.

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

Completeness2/5

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

Without output schema or parameter details, the description lacks completeness. It does not explain the full async flow (e.g., use get_query to retrieve results) or mention cancellation via cancel_query. For a tool initiating an async operation, this is insufficient.

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

Parameters1/5

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

Schema description coverage is 0%, yet the description says nothing about parameters. It does not explain sql format, connection_id purpose, or limit behavior. The description adds no meaning beyond the schema field names.

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 specifies 'Start an asynchronous read-only SELECT or CTE query.' This is a clear verb-resource pair with specific constraints (async, read-only, query type), distinguishing it from siblings like run_select (likely synchronous) and describe_table (describes schema).

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives such as run_select or get_query. It does not explain the async nature implies subsequent polling or result retrieval. No exclusions or contexts are given.

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. Dates show when Glama detected each change.

  1. 1 tool updatev0.4.0
    • Addedexport_query_file
  2. 12 tool updatesv0.3.0
    • Addedcancel_query
    • Addeddescribe_table
    • Addedexplain_query
    • Addedget_query
    • Addedget_table_sample
    • Addedimport_table_file
    • Addedlist_connections
    • Addedlist_databases
    • Addedlist_schemas
    • Addedlist_tables
    • Addedrun_select
    • Addedstart_query
  3. 8 tool updatesv0.1.2
    • Removeddescribe_table
    • Removedexplain_query
    • Removedget_table_sample
    • Removedlist_connections
    • Removedlist_databases
    • Removedlist_schemas
    • Removedlist_tables
    • Removedrun_select
  4. 8 tool updatesv0.1.3
    • First observeddescribe_table
    • First observedexplain_query
    • First observedget_table_sample
    • First observedlist_connections
    • First observedlist_databases
    • First observedlist_schemas
    • First observedlist_tables
    • First observedrun_select

TDQS

A3.5/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: cancel_query, describe_table, explain_query, etc. The only potentially overlapping pair (run_select and start_query) are distinguished by synchronous vs asynchronous execution, and descriptions make this explicit.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern in snake_case, e.g., list_connections, run_select, export_query_file. No mixing of styles or ambiguous verb usage.

Tool Count5/5

With 13 tools, the set is well-scoped for a SQL query interface. It covers all necessary operations without being bloated or insufficient.

Completeness4/5

The tool surface covers schema discovery, synchronous and asynchronous queries, query explanation, export, and import. Minor gaps include lack of a tool to modify queries or view history, but core workflows are well supported.

Maintenance

ActivityInactive
ResponsivenessWithin a week

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    A
    maintenance
    The Multi DB MCP Server is a high-performance implementation of the Database Model Context Protocol designed to revolutionize how AI agents interact with databases. Currently supporting MySQL and PostgreSQL databases.
    420
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    An MCP server that enables AI assistants to create and manage persistent SQLite databases through natural language without requiring SQL knowledge. It allows users to propose schemas, store records, and perform complex queries across multiple databases for structured data tracking.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Zero-config MCP server that empowers AI agents to safely query SQL and NoSQL databases like PostgreSQL, MySQL, SQLite, MongoDB, and Redis.
    24
    1
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/andyWang1688/sql-query-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server