Skip to main content
Glama

SQL 生成与优化(按次计费)

sqlgen

按表结构生成/优化 SQL,自动拦截破坏性语句。按次计费:业务成功才确认扣款,内容违规、模型超时或生成失败会自动全额退款。

Input Schema

NameRequiredDescriptionDefault
schemaNo相关表结构(CREATE TABLE 或字段说明),给得越准 SQL 越准。
dialectNo数据库类型。mysql
questionYes查询需求,例如「统计最近 7 天每日新增用户数」。
requestIdNo幂等键。同一次业务重试时复用同一个值,可避免重复扣费。

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

B3.4/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 burden and does add real behavioral value: automatic interception of destructive statements and a per-call billing model where charges confirm only on success and auto-refund on violation/timeout/failure. It still leaves ambiguous whether the SQL is merely generated or actually executed, and says nothing about latency or response shape.

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?

Two sentences, front-loaded with the core capability before the billing caveat; no filler. The billing sentence is slightly long but every clause (success-only charge, auto-refund triggers) is decision-relevant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 4-param, no-annotation, no-output-schema tool, the definition covers purpose, safety and cost but omits what the caller receives (SQL text only? explanation? result rows?) and whether execution occurs. That return-value gap matters precisely because there is no output schema to fill it.

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 all four parameters (including the dialect enum and requestId idempotency key) are already documented in the schema. The description only echoes '按表结构' for the schema param and adds no syntax or format detail beyond that, so baseline 3 applies.

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 states a specific verb and resource — generating/optimizing SQL from table schemas — plus an extra behavior (destructive-statement interception). It doesn't name the closest siblings (codegen, script, testgen), but 'SQL' is a sharp enough resource to distinguish it in practice.

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

Usage Guidelines2/5

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

There is no guidance on when to pick this over codegen or script, nor any exclusions or prerequisites. The only conditional content is about billing/refund outcomes, which is not usage routing.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.