Skip to main content
Glama

Frequency

frequency
Read-only

Computes a univariate frequency table for a SAS dataset column, returning counts and percentages with decoded value labels and optional missing-value handling.

Instructions

单变量频数表:各取值的 n 与占比,默认自动套用 SAS 值标签。

结果按 n 降序;原始 value 与解码后的 label 一并返回。 denominator 回传百分比的分母(include_missing 为 True 时是总行数,否则是非缺失行数)。

Input Schema

NameRequiredDescriptionDefault
pathYes数据集路径,相对 SAS_DATA_ROOT 或绝对路径。
limitNo返回取值个数(默认 50,上限 SAS_LOCAL_MCP_MAX_AGG_ROWS)。
columnYes要统计的变量名。
offsetNo起始序号,用于翻页看长尾取值。
apply_labelsNo默认 True,把 coded 值译为值标签文本(coded 值本身不可读)。
include_missingNo默认 False;为 True 时把缺失单列为一档并计入分母。

Output 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?

Annotations already declare readOnly/non-destructive/closed-world, so safety is covered. The description adds real behavioral detail not in the annotations: results are sorted by n descending, labels are auto-applied by default, and the denominator rule changes with include_missing. It does not mention the row cap behavior beyond limit, but that is in the schema.

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?

Three short, front-loaded lines: what it computes, how output is shaped, and how denominators work. No filler; the only redundancy is restating label application that also appears in the schema.

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 6 params at 100% schema coverage, an output schema, and read-only annotations, the description covers the remaining interpretive gaps (ordering, label decoding, denominator). Nothing an agent needs to call it correctly is missing, though sibling disambiguation would complete it.

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 baseline would be 3. The description earns more by explaining the consequence of include_missing on the percentage denominator ('total row count when True, otherwise non-missing'), which is a semantic effect the schema text does not spell out.

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 opens with a specific verb+resource pair (单变量频数表 – univariate frequency table) and states what is produced (n and percentage per distinct value). It implicitly separates itself from summarize_dataset/query_dataset by being single-column distribution counting, but never names a sibling 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?

The usage context is implied by the label '单变量频数表' and the limits on value count, but there is no explicit guidance on when to choose this over summarize_dataset or query_dataset, nor any stated prerequisites (e.g. that a dataset path under SAS_DATA_ROOT is required).

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