Nhanes Tools

Configuration File: nhanes_tools.json Tool Type: Local Tools Count: 3

This page contains all tools defined in the nhanes_tools.json configuration file.

Available Tools

NHANES_download_and_parse (Type: NHANESTool)

Download and parse NHANES XPT data files from CDC into structured JSON (DataFrame-ready). Bridges…

NHANES_download_and_parse tool specification

Tool Information:

  • Name: NHANES_download_and_parse

  • Type: NHANESTool

  • Description: Download and parse NHANES XPT data files from CDC into structured JSON (DataFrame-ready). Bridges dataset discovery to analysis by handling XPT download, parsing, optional variable selection, and age filtering. For standard components (Demographics, Dietary, Examination/BodyMeasures, Questionnaire), the tool auto-resolves the filename from the cycle suffix. For Laboratory data, provide the exact dataset_name (e.g., ‘CBC’, ‘BIOPRO’, ‘GHB’, ‘GLU’, ‘TRIGLY’, ‘HDL’, ‘TCHOL’). Returns column metadata, summary statistics, and the first 5000 rows as JSON records. Use nhanes_search_datasets first to discover available dataset names if unsure.

Parameters:

  • component (string) (required) NHANES component category. ‘Dietary’ = Day 1 intake totals (DR1TOT), ‘DietaryDay2’ = Day 2 (DR2TOT), ‘BodyMeasures’ = BMX, ‘Examination’ = general exam. For Laboratory, also provide dataset_name.

  • cycle (string) (required) NHANES survey cycle (e.g., ‘2017-2018’, ‘2015-2016’, ‘2013-2014’, ‘2011-2012’)

  • dataset_name (string) (optional) Exact NHANES dataset filename prefix (without cycle suffix). Required for Laboratory (e.g., ‘CBC’, ‘BIOPRO’, ‘GHB’, ‘GLU’, ‘TRIGLY’, ‘HDL’, ‘TCHOL’). Optional for other components to override the default filename.

  • variables (array) (optional) List of variable names to select (e.g., [‘SEQN’, ‘DR1TIRON’, ‘DR1TKCAL’]). SEQN is always included. If omitted, all variables are returned.

  • age_min (number) (optional) Minimum age filter (inclusive). Filters by RIDAGEYR from Demographics. Auto-merges with DEMO file if the requested component is not Demographics.

  • age_max (number) (optional) Maximum age filter (inclusive). Filters by RIDAGEYR from Demographics.

  • max_rows (integer) (optional) Maximum number of data rows to return (default: 5000). Set lower for faster responses.

Example Usage:

query = {
    "name": "NHANES_download_and_parse",
    "arguments": {
        "component": "example_value",
        "cycle": "example_value"
    }
}
result = tu.run(query)

nhanes_get_dataset_info (Type: NHANESTool)

Get information about NHANES (National Health and Nutrition Examination Survey) datasets. NHANES …

nhanes_get_dataset_info tool specification

Tool Information:

  • Name: nhanes_get_dataset_info

  • Type: NHANESTool

  • Description: Get information about NHANES (National Health and Nutrition Examination Survey) datasets. NHANES data is typically available as downloadable files (SAS, XPT formats) from the CDC website. This tool provides information about available datasets, years, and download links. Note: Actual data retrieval may require downloading and converting files.

Parameters:

  • year (string) (optional) NHANES cycle/year (e.g., ‘2017-2018’, ‘2015-2016’, ‘2013-2014’)

  • component (string) (optional) Optional component type to filter datasets

Example Usage:

query = {
    "name": "nhanes_get_dataset_info",
    "arguments": {
    }
}
result = tu.run(query)

nhanes_search_datasets (Type: NHANESTool)

Search for NHANES datasets by keyword. Returns information about matching datasets including down…

nhanes_search_datasets tool specification

Tool Information:

  • Name: nhanes_search_datasets

  • Type: NHANESTool

  • Description: Search for NHANES datasets by keyword. Returns information about matching datasets including download links. Note: NHANES data files are typically in SAS/XPT format and may require conversion tools.

Parameters:

  • search_term (string) (optional) Search term to find datasets (e.g., ‘glucose’, ‘blood pressure’, ‘diabetes’)

  • year (string) (optional) Optional NHANES cycle to filter (e.g., ‘2017-2018’)

  • limit (integer) (optional) Maximum number of results (default: 20)

Example Usage:

query = {
    "name": "nhanes_search_datasets",
    "arguments": {
    }
}
result = tu.run(query)