Skip to main content
Glama
gxc

gaussdb-ro-mcp

by gxc

execute_select

Run single read-only SELECT/WITH queries on GaussDB for safe data exploration, counts, aggregates, sampling, and top-N retrieval after table discovery.

Instructions

执行只读 SELECT 查询(本服务器唯一允许的 SQL 入口)。仅接受单条 SELECT/WITH 语句:拒绝 DML/DDL、SELECT INTO、FOR UPDATE/SHARE 行锁、多语句与危险函数;查询在服务端强制的只读事务中执行。适用场景:在 list_tables/describe_table 定位目标后做数据探查与统计(计数、聚合、抽样、排序取前 N 行)。max_rows 控制本次返回行数(默认取实例配置,受服务端硬上限约束);大结果集建议用 LIMIT 或聚合减少传输。

Input Schema

NameRequiredDescriptionDefault
sqlYes要执行的 SELECT 语句(必填),仅允许单条 SELECT/WITH 查询
instanceNo数据源名称,省略时使用默认实例。可选实例:demo(默认)
max_rowsNo本次返回的最大行数,默认取实例配置,上限受服务端限制

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.3.0
    • changedInput schema / properties / instance / description
      Previous value: -"数据源名称(配置文件中 instance 的 name),省略时使用默认实例"New value: +"数据源名称,省略时使用默认实例。可选实例:demo(默认)"
  2. First observedv0.2.2

TDQS

A4.6/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 behavioral burden and does so well: it enumerates what is rejected (DML/DDL, SELECT INTO, FOR UPDATE/SHARE row locks, multi-statement, dangerous functions) and states that execution happens inside a server-enforced read-only transaction. It also discloses that max_rows defaults to instance config and is bounded by a server hard cap, which is exactly the kind of constraint an agent needs to avoid failed or oversized calls.

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 text is front-loaded with the core purpose, then constraints, then usage, then the max_rows note — a logical progression with no filler. It is dense but every clause about rejection rules earns its place; the closing max_rows sentence is mildly redundant with the schema description.

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 mutation-free query tool with no annotations and no output schema, the description supplies the safety profile (read-only transaction, rejected statement types), the workflow position relative to siblings, and the row-limit behavior. An agent has everything needed to construct a valid call and anticipate rejection conditions.

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 description coverage is 100%, so the schema already documents sql, instance, and max_rows, giving a baseline of 3. The description largely restates those constraints (single SELECT/WITH, default row limit, server cap) without adding syntax, format, or error-handling detail beyond the schema; the instance parameter is not elaborated on at all.

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 states a specific verb and resource (execute a read-only SELECT query) and immediately frames scope: '本服务器唯一允许的 SQL 入口' (the only allowed SQL entry point on this server). It also distinguishes itself from siblings by describing the workflow with list_tables/describe_table as the locating step, so an agent can tell it apart from the metadata tools without opening any schema.

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

Usage Guidelines5/5

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

Usage is explicit: use it after locating a target via list_tables/describe_table for data exploration and statistics (counts, aggregation, sampling, top-N ordering). It also gives an operational alternative rule — prefer LIMIT or aggregation for large result sets to reduce transfer. Both when-to-use and the sibling workflow are stated, leaving little to inference.

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