Skip to main content
Glama

Summarize Dataset

summarize_dataset
Read-only

Profile every variable in a SAS dataset without writing SQL: get types, non-null and missing counts, missing rates, distinct counts, and numeric, date, or character distributions in one pass.

Instructions

逐变量概要统计——了解一张表的首选入口,省去手写 SQL。

每个变量给出:类型、非空数 n、缺失数 n_missing、缺失率 pct_missing、 唯一值数 n_distinct,以及 has_value_labels(有值标签时改用 frequency 看解码分布)。 再按类型给分布指标: 数值 -> mean/std/min/p25/median/p75/max; 日期 -> min/max; 字符 -> max_length 与 Top5 取值(value/label/n/pct)。

Input Schema

NameRequiredDescriptionDefault
pathYes数据集路径,相对 SAS_DATA_ROOT 或绝对路径。
columnsNo可选,只统计这些变量;不传则统计全部。
apply_labelsNo字符型 Top5 是否套用 SAS 值标签。

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, non-destructive, closed-world), and the description goes further by enumerating exactly which per-variable metrics are produced and how metrics vary by column type. That is genuine behavioral context beyond the annotations, though it omits practical traits such as cost or handling of very wide tables.

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 purpose and the 'entry point' claim are front-loaded in the first clause, followed by a structured enumeration of returned metrics. The per-type metric list is dense but each line carries information an agent needs; only slightly longer than necessary.

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?

With an output schema present, return values need not be explained, yet the description still documents them at a semantic level, and annotations plus full schema coverage handle safety and parameters. The only gap is guidance relative to the other read-oriented siblings, which a user of this complex a tool family would benefit from.

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 path, columns and apply_labels are already fully documented in the schema. The description adds no syntax, default or format detail for those parameters — the mention of value labels only implies what apply_labels touches. Baseline 3 is appropriate.

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 opens with a specific verb+resource (per-variable summary statistics) and states the tool's role explicitly as the preferred entry point for understanding a table. It also names the sibling it defers to (frequency) for labelled variables, so an agent can distinguish it from alternatives 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 Guidelines4/5

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

It gives a clear usage condition — use this first to understand a table without writing SQL — and an explicit exclusion: when has_value_labels is true, use frequency to see decoded distributions. It does not, however, position itself against read_dataset, get_dataset_metadata or query_dataset, so the routing picture is only partial.

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