Skip to main content
Glama

survey_frequency

Calculate weighted distributions of a categorical variable in NHANES data, returning unweighted counts, weighted percentages, standard errors, and confidence intervals for each category.

Instructions

Weighted distribution of a categorical variable (Table 1 style): for each level, unweighted n, weighted percent, SE and Korn-Graubard CI, within the domain and optionally by group. labels: optional {code: label} map, e.g. {"1": "Male", "2": "Female"}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
byNo
domainNo
labelsNo
variableYes
dataset_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations provided, the description carries the full behavioral disclosure burden. It discloses the exact computed outputs, the optional domain/by behavior, and the labels mapping, which is strong for a read-only tabulation tool. It does not discuss missing-value handling or output ordering, but those are minor gaps given the amount of detail present.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two dense sentences with no filler. The core behavior and output statistics are front-loaded, and the only extra note is the labels parameter example, which earns its place.

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?

Given no output schema and no annotations, the description covers the essential output columns, optional parameter behavior, and label formatting. It could be more explicit about when this tool should be chosen over its survey-focused siblings, but it is otherwise sufficient for an agent to call it correctly.

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 for all five parameters. It clarifies the labels map with a concrete example and explains that domain and by scope/group the output, but dataset_id and variable are left entirely to inference from their names.

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 resource and action: a weighted distribution of a categorical variable in Table 1 style, with explicit output statistics (unweighted n, weighted percent, SE, Korn-Graubard CI). It is clear, but it does not explicitly name or contrast sibling tools such as survey_estimate or describe_variable.

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 rather than stated: the description indicates this is for categorical variables and supports domain and optional grouping, but it gives no explicit when-to-use or when-not-to-use guidance. It does not mention alternatives or exclusions among the sibling survey tools.

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