Skip to main content
Glama

run_query

Execute read-only SQL queries against socioeconomic survey microdata, returning up to 500 rows in 30 seconds. Use weighted columns for overall statistics and quote uppercase table or column names.

Instructions

执行一条只读 SQL 查询并返回结果。只接受 SELECT / WITH / EXPLAIN 等只读语句,单次最多返回 500 行,超时 30 秒。表名列名含大写字母时记得加双引号。统计总体指标时请使用表里的抽样权重列加权。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes一条只读 SQL 语句,不要加结尾分号
limitNo最多返回多少行

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/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 discloses the read-only enforcement (SELECT/WITH/EXPLAIN), a hard 500-row cap, and a 30-second timeout — exactly the operational traits an agent needs. It omits what happens on rejection or how to page past 500 rows, so it is strong but not exhaustive.

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?

Four sentences, front-loaded with what the tool does before the constraints, then syntax and domain tips. Every sentence carries information, though the weighting advice sits slightly apart from the query-execution mechanics.

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?

An output schema exists so return values need not be described, and the description still covers safety, limits, timeout, and identifier-quoting pitfalls. With no annotations to lean on, the remaining gap is error behavior and pagination semantics beyond the 500-row ceiling.

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 coverage is 100%, so the baseline is 3, but the description adds real semantics: the allowed statement classes for the sql parameter, the requirement to double-quote uppercase identifiers, and the weight-column convention for aggregate metrics. The limit parameter's 500-row ceiling is stated, though the description doesn't explain how it interacts with the server-side cap.

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?

States a specific verb+resource ('执行一条只读 SQL 查询并返回结果') with the scope qualifier '只读'. It is clearly distinguishable in practice from metadata-oriented siblings like describe_table and sample_rows, but it never names an alternative, so it stops short of explicit sibling differentiation.

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?

It defines the usage envelope (read-only statements only, 500-row cap, 30s timeout, weighting advice for aggregate metrics), which implicitly tells the agent when this tool applies. However, it never says when to prefer run_query over describe_table, sample_rows, variable_stats, or plot_variable, so routing guidance is left to inference.

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