Skip to main content
Glama
CGAdmin544

多数据库 MCP Server

by CGAdmin544

execute_query

Executes read-only SQL queries (SELECT/WITH) and returns results as a JSON array, with an optional schema parameter for unqualified table names.

Instructions

执行只读 SQL 查询(仅允许 SELECT/WITH),结果以 JSON 数组返回。

Args: sql: SELECT 语句,绑定变量使用 :name 占位(不要字符串拼接值)。 schemaName: 指定默认 schema,未限定表名将解析到该 schema(如 "SCOTT")。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
schemaNameNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.4/5.0
Behavior4/5

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

The description discloses key behaviors: it is read-only, only allows SELECT/WITH, returns a JSON array, and provides guidance on bind variables and schema resolution. This goes beyond minimal expectations, though it does not mention error handling or side effects, which are not critical for a read-only query 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 concise and well-structured, using bullet-point style for arguments. It conveys all necessary information without unnecessary verbosity, making it easy to parse.

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?

The description covers the tool's purpose, input parameters, and output format (JSON array), which is sufficient for a read-only query tool. Since an output schema exists, the description does not need to detail the return structure further. It is complete for its scope.

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?

The description explains both parameters in detail. For 'sql', it specifies that SELECT/WITH are allowed and that bind variables should use :name placeholders (avoiding string concatenation). For 'schemaName', it explains that it sets the default schema for unqualified table names, with an example. This fully compensates for the lack of schema-level descriptions.

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: executing read-only SQL queries (SELECT/WITH only) and returning results as a JSON array. This distinguishes it from sibling tools like list_tables and describe_table, which have different functions.

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 does not explicitly state when to use this tool versus its siblings. While the purpose is implicit, there is no direct guidance such as 'use this for querying data instead of describing schemas.' The description focuses on how to use it, not when to choose it among alternatives.

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