Skip to main content
Glama
andychinghk01

db-query-mcp

query

Execute read-only SQL queries on a chosen MySQL or PostgreSQL database, with optional parameterized values and support for statements like SELECT, SHOW, DESCRIBE, and EXPLAIN.

Instructions

Execute a read-only SELECT query against a selected MySQL or PostgreSQL database. Supports optional parameterized values. Only SELECT/SHOW/DESCRIBE/EXPLAIN statements are allowed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesA read-only SQL SELECT statement.
dbNameYesThe name of the database to query (as shown by list_db).
paramsNoOptional positional parameters for the SQL statement. Use ? placeholders for MySQL or $1, $2, ... for PostgreSQL.
Behavior4/5

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

No annotations are provided, but the description carries the burden by specifying the tool is read-only and enumerating allowed statement types (SELECT/SHOW/DESCRIBE/EXPLAIN). It also mentions parameterized values with placeholder syntax for MySQL/PostgreSQL, giving useful behavioral context. It doesn't describe output format, but for a query tool this is sufficient.

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?

Two sentences, front-loaded with the core purpose, and no redundant information. Every sentence contributes meaning, making it an efficient description.

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?

The description covers the key aspects for a moderate-complexity tool: read-only constraint, allowed statements, and parameterization. It lacks an explicit mention of the result format, but given no output schema and the straightforward nature of a query tool, it is sufficiently complete.

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?

Schema coverage is 100%, with parameter descriptions already documenting sql, dbName, and params. The description additionally reinforces the read-only constraint and clarifies that dbName is as shown by list_db, but doesn't add significant new semantics beyond the schema. Baseline 3 is appropriate.

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 executes read-only SQL queries (SELECT/SHOW/DESCRIBE/EXPLAIN) against a MySQL/PostgreSQL database, using a specific verb and resource. It distinguishes itself from sibling list_db, which lists databases, by focusing on query execution.

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?

It clearly implies usage for read-only querying against a chosen database, referencing list_db for database selection. However, it doesn't explicitly state 'use this instead of list_db when you need to retrieve data,' making it a clear context but without explicit exclusionary guidance.

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

Install Server

Other Tools

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/andychinghk01/db-query-mcp'

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