Skip to main content
Glama

measure_sql

Measures downstream SQL complexity by checking CASE WHEN usage, JOIN depth, subquery nesting, and nested aggregations to assess query risk.

Instructions

度量下游取数复杂度(CASE WHEN / JOIN 深度 / 子查询层数 / 聚合套聚合)。

Args: sql: 待检查的 SQL 文本。

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "measure_sql"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

B3.2/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full behavioral burden. It discloses the analysis dimensions, which is useful, but never states that this is a non-mutating read/analysis operation, what happens with an empty or invalid SQL string, or whether it needs a specific SQL dialect.

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?

One front-loaded sentence with zero filler, followed by a compact Args block. The trailing newline artifact and the docstring-style formatting are minor noise but nothing is redundant.

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?

An output schema exists, so return values need no explanation, and the single-parameter surface is small. Still missing is whether an empty default is treated as valid input and whether the tool parses or merely pattern-matches the SQL, which matters for correct invocation.

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 0%, so the description must compensate; its Args block does define `sql` as the SQL text to be checked, which is real added meaning. However, it does not address the empty-string default or the fact that no parameter is required, so the parameter behavior remains partly ambiguous.

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 names a concrete operation and enumerates the exact complexity dimensions measured (CASE WHEN count, JOIN depth, subquery nesting, nested aggregation), so an agent knows precisely what it computes. It does not differentiate itself from siblings like analyze_table or check_conformed_facts, leaving the boundary implicit.

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 when-to-use or when-not-to-use guidance and no mention of alternatives or prerequisites. The agent must infer that this is the tool for scoring query complexity purely from the verb 'measure' and the listed dimensions.

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