Skip to main content
Glama
jovian-zhibai

mcp-database

query

Execute read-only SQL queries (SELECT, SHOW, DESCRIBE, EXPLAIN) and get results, supporting database selection, row limits, and connection names.

Instructions

Execute a read-only SQL query (SELECT, SHOW, DESCRIBE, EXPLAIN) and return results.

Args: sql: SQL query to execute. database: Name of the database within the connection (optional). max_rows: Maximum number of rows to return (default: 100). connection_name: Name of the database connection (default: "default").

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
databaseNo
max_rowsNo
connection_nameNodefault

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral transparency burden. It clearly discloses that the tool is read-only, restricts to specific statement types, and documents row limiting via max_rows. It does not mention error behavior or enforcement of the read-only constraint, but the core safety-critical behavior is well covered.

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 front-loaded with the purpose and then followed by a compact, well-organized argument list. Every sentence and line earns its place; there is no fluff or repetition.

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?

For a four-parameter read-only query tool, the description covers the purpose, allowed SQL types, and parameter semantics, with an output schema handling return-value documentation. The main gap is the lack of explicit guidance on how this tool relates to siblings like execute and explain_query, but the core invocation context is 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?

Schema description coverage is 0%, so the description must compensate. It provides meaningful explanations for all four parameters, including that database is optional, max_rows caps the result size, and connection_name selects the connection. The explanations are concise and mostly add value beyond the bare schema.

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 a specific verb and resource: it executes a read-only SQL query and lists the allowed statement types (SELECT, SHOW, DESCRIBE, EXPLAIN). This distinguishes it from likely write-oriented siblings like execute, though it does not explicitly differentiate itself from explain_query or sample_rows.

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 read-only qualifier implies when to use this tool, and the allowed SQL statement types provide useful scope. However, it does not explicitly state when not to use it or mention alternatives such as execute for write operations, leaving the routing partly to inference.

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