Skip to main content
Glama

survey_estimate

Calculate survey-weighted means, proportions, or totals from NHANES data with design-based standard errors, subgroup domains, and optional age adjustment.

Instructions

Design-based estimate (Taylor linearization) of a mean, proportion (0/1 variable) or total. domain: expression defining the subpopulation, e.g. 'RIDAGEYR >= 20 & RIDEXPRG != 1' (the design is NOT subset; out-of-domain records get zero weight). by: grouping variables, e.g. ['RIAGENDR']. age_adjust: 'nchs_adults_20plus' for NCHS direct age standardization (2000 census; 20-39/40-59/60+). Proportions come with Korn-Graubard CIs and NCHS reliability flags.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
byNo
domainNo
variableYes
statisticNomean
age_adjustNo
dataset_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.3/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 burden. It discloses that the design is NOT subset (out-of-domain records get zero weight), which is a critical behavioral detail. It also mentions Korn-Graubard CIs and NCHS reliability flags for proportions. It does not mention whether the tool is read-only or if it modifies data, but the description strongly implies a read-only estimation operation.

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 description is compact and front-loaded with the core purpose. The examples for domain, by, and age_adjust are useful and not redundant. The final sentence about proportions adds important detail. It could be slightly more structured, but it 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 key behavioral aspects: what statistics are supported, how domain works, how by works, and what age_adjust does. It does not describe the return format or error conditions, but for a survey estimation tool, the core usage is well covered. The sibling context suggests this is one of several survey tools, and the description gives enough to distinguish 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 description coverage is 0%, so the description must compensate. It explains domain with an example, by with an example, and age_adjust with a specific value. It does not explain dataset_id or variable, but those are self-evident from the tool name and context. The statistic parameter is not explicitly described, but the first sentence lists mean, proportion, and total, which covers it.

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 states a specific verb ('estimate') and resource ('mean, proportion, or total' via design-based Taylor linearization), and distinguishes itself from siblings like survey_regression and survey_frequency by naming the statistics it produces. It also clarifies the domain behavior (out-of-domain records get zero weight), which is a key differentiator.

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?

The description gives concrete examples for domain and by parameters, and mentions age_adjust for NCHS standardization. It does not explicitly say when to use this tool instead of survey_regression or survey_frequency, but the statistic list and design-based framing imply the intended use. Sibling names are present, but no explicit exclusions are given.

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