nhanes-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| NHANES_MCP_CACHE | No | Override cache directory for downloaded data. | |
| NHANES_MCP_DATA_DIR | No | Folder of manually downloaded .xpt files to work offline. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_cyclesA | List NHANES cycles this server supports, their file-name conventions and weight rules. |
| analysis_guidanceA | Rules for valid NHANES estimation that this server enforces. Read before analyzing. |
| list_filesC | List data files for a cycle and component (Demographics, Dietary, Examination, Laboratory, Questionnaire). |
| search_variablesA | Search NHANES variable names/descriptions (regex, case-insensitive) across cycles/components. Defaults to the 2017-2018 cycle and all components. |
| describe_variableB | Codebook entry (label, question text, target population, value codes) plus observed distribution. Flags codes that look like refused/don't-know so they can be set to missing. |
| build_datasetA | Build an analysis-ready dataset: DEMO universe (all participants, needed for valid domain estimation) left-joined to the requested tables on SEQN, for one or more cycles. tables: base names without cycle suffix, e.g. ["BMX", "TCHOL", "BPQ"] (DEMO is always included). variables: columns to keep from those tables (default: all). Weight/design variables are always kept. The analysis weight is chosen and rescaled automatically -> column WT_ANALYSIS. |
| describe_datasetC | Columns, non-missing counts, weight choice, derived-variable definitions and warnings. |
| set_missingC | Recode sentinel values (e.g. 7, 9, 77, 99 for refused/don't know) to missing. |
| derive_variableA | Create a variable from an expression over existing columns, e.g. name='OBESE', expression='BMXBMI >= 30' (booleans become 0/1). missing: 'any' -> result missing if ANY referenced column is missing (default, conservative); 'all' -> missing only if ALL referenced columns are missing (for OR-type definitions); 'none' -> no propagation. |
| survey_estimateA | 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. |
| survey_regressionA | Survey-weighted linear ('gaussian') or logistic ('binomial') regression with design-based SEs. Categorical predictors must be dummy-coded first with derive_variable. |
| flag_from_long_tableA | Add a per-person 0/1 indicator from a file with several rows per participant (e.g. RXQ_RX
prescriptions, DR1IFF foods). Flag = 1 if ANY row's value in ANY of |
| survey_frequencyA | 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"}. |
| survey_coxA | Survey-weighted Cox proportional hazards model (Breslow ties, Binder linearized variance; same estimator as SUDAAN SURVIVAL / R svycoxph). Typical use with include_mortality=True: time='PERMTH_INT' (or PERMTH_EXM), event='MORTSTAT', domain including 'ELIGSTAT == 1'. Categorical predictors must be dummy-coded first with derive_variable. |
| export_datasetA | Write the analytic dataset (with WT_ANALYSIS, SDMVSTRA_U, SDMVPSU) to CSV plus a provenance sidecar. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 15 tools
Each tool maps to a distinct NHANES workflow step: discovery, variable lookup, dataset construction, cleaning, derivation, and a specific survey estimator. Even similar pairs like describe_variable/describe_dataset and survey_estimate/survey_frequency are separated by clear resource and statistical-output differences.
The tools overwhelmingly follow a lowercase snake_case verb_noun pattern such as list_files, build_dataset, and export_dataset. Minor deviations like analysis_guidance and the survey_* family break the strict verb-first style, but the naming remains predictable and readable.
Fifteen tools is at the upper edge of the ideal range, but every tool earns its place by covering a necessary stage in the NHANES analysis pipeline. There is no redundancy or filler.
The toolkit covers the full analytic lifecycle: data discovery, codebook inspection, dataset assembly, missing-value handling, variable derivation, survey-weighted descriptive statistics, regression, survival analysis, and export. The analysis_guidance tool also addresses domain-specific estimation rules that would otherwise be a critical gap.