Skip to main content
Glama

variable_stats

Compute statistics for a survey variable: non-empty and valid responses, missing-value codes identified from metadata, value distribution, numeric summaries, and available weight columns.

Instructions

统计一个变量:有多少非空回答、排除缺失值编码后的有效回答、取值分布(带码值含义)、数值型的描述统计(均值/中位数/标准差)、以及可用的抽样权重列。缺失值编码(98=不知道、99=缺失这类)会根据元数据自动识别并单独报告,不是靠猜 96-99;元数据里查不到值标签时会明确说明无法判断。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableYes表名,如 final_ED_CSES(大小写敏感)
columnYes列名,如 years_attended_school
schemaNoschema 名。省略时自动按表名解析
weightNo抽样权重列名。算总体量时应该传,返回值里会列出可用的权重列

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full behavioral burden, and it does disclose non-obvious behavior: missing-value codes are auto-detected from metadata rather than heuristically guessing 96-99, codes are reported separately, and the tool explicitly signals when value labels cannot be resolved. This is meaningful transparency, with only auth/performance characteristics left unaddressed.

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 content is front-loaded with the core purpose and then details the missing-value handling, which is the most valuable differentiator. It is dense but each clause (counts, distribution, descriptives, weights, missing-code logic) earns its place, with no filler.

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 explained, yet the description still clarifies the semantics of what is returned (valid vs non-null, code meanings). Combined with the absence of annotations, the description covers the behavioral surface an agent needs; only cross-tool routing guidance is missing.

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 (table, column, schema, weight) are already documented in the schema. The description adds only a light framing note that sampling weight columns are surfaced, which does not go beyond the schema's own explanation. 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 names a specific verb and resource: computing statistics for a single variable, enumerating exactly what is returned (non-null counts, valid counts after missing-code exclusion, value distribution with code meanings, numeric descriptives, available weight columns). This is clearly distinct from sibling tools like describe_table or plot_variable, though no sibling is named explicitly.

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?

Usage is implied by the scope of the outputs — an agent can infer this is the tool to reach for when it needs per-variable summary statistics. However, there is no explicit when-to-use versus alternatives (e.g., describe_table vs run_query vs plot_variable) and no stated prerequisites or exclusions.

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