KosmoKrator

data

openFDA CLI for AI Agents

Use the openFDA CLI from KosmoKrator to call openFDA tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

openFDA CLI Setup

openFDA can be configured headlessly with `kosmokrator integrations:configure openfda`.

Install, configure, and verify
# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure openfda --enable --read allow --write ask --json
kosmokrator integrations:doctor openfda --json
kosmokrator integrations:status --json

Credentials

Authentication type: No credentials none. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.

No credentials are required.

Command Patterns

The generic command is stable across every integration. The provider shortcut is shorter for humans.

Generic CLI call
kosmo integrations:call openfda.openfda_drug_event '{}' --json
Provider shortcut
kosmo integrations:openfda openfda_drug_event '{}' --json

Discovery

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

Discovery commands
kosmo integrations:docs openfda --json
kosmo integrations:docs openfda.openfda_drug_event --json
kosmo integrations:schema openfda.openfda_drug_event --json
kosmo integrations:search "openFDA" --json
kosmo integrations:list --json

Automation Contexts

The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.

CLI Functions

Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.

openfda.openfda_drug_event

Query FAERS drug adverse event reports.

Read read
Parameters
none
Generic call
kosmo integrations:call openfda.openfda_drug_event '{}' --json
Shortcut
kosmo integrations:openfda openfda_drug_event '{}' --json

openfda.openfda_drug_label

Query structured product labeling records.

Read read
Parameters
none
Generic call
kosmo integrations:call openfda.openfda_drug_label '{}' --json
Shortcut
kosmo integrations:openfda openfda_drug_label '{}' --json

openfda.openfda_drug_enforcement

Query drug recall enforcement reports.

Read read
Parameters
none
Generic call
kosmo integrations:call openfda.openfda_drug_enforcement '{}' --json
Shortcut
kosmo integrations:openfda openfda_drug_enforcement '{}' --json

openfda.openfda_drug_ndc

Query NDC directory product listings.

Read read
Parameters
none
Generic call
kosmo integrations:call openfda.openfda_drug_ndc '{}' --json
Shortcut
kosmo integrations:openfda openfda_drug_ndc '{}' --json

openfda.openfda_drug_drugsfda

Query Drugs@FDA application data.

Read read
Parameters
none
Generic call
kosmo integrations:call openfda.openfda_drug_drugsfda '{}' --json
Shortcut
kosmo integrations:openfda openfda_drug_drugsfda '{}' --json

openfda.openfda_drug_shortages

Query FDA drug shortage data.

Read read
Parameters
none
Generic call
kosmo integrations:call openfda.openfda_drug_shortages '{}' --json
Shortcut
kosmo integrations:openfda openfda_drug_shortages '{}' --json

openfda.openfda_device_510k

Query medical device 510(k) clearances.

Read read
Parameters
none
Generic call
kosmo integrations:call openfda.openfda_device_510k '{}' --json
Shortcut
kosmo integrations:openfda openfda_device_510k '{}' --json

openfda.openfda_device_classification

Query device classification records.

Read read
Parameters
none
Generic call
kosmo integrations:call openfda.openfda_device_classification '{}' --json
Shortcut
kosmo integrations:openfda openfda_device_classification '{}' --json

openfda.openfda_device_enforcement

Query device recall enforcement reports.

Read read
Parameters
none
Generic call
kosmo integrations:call openfda.openfda_device_enforcement '{}' --json
Shortcut
kosmo integrations:openfda openfda_device_enforcement '{}' --json

openfda.openfda_device_event

Query MAUDE medical device adverse events.

Read read
Parameters
none
Generic call
kosmo integrations:call openfda.openfda_device_event '{}' --json
Shortcut
kosmo integrations:openfda openfda_device_event '{}' --json

openfda.openfda_device_pma

Query premarket approval records.

Read read
Parameters
none
Generic call
kosmo integrations:call openfda.openfda_device_pma '{}' --json
Shortcut
kosmo integrations:openfda openfda_device_pma '{}' --json

openfda.openfda_device_recall

Query device recall records.

Read read
Parameters
none
Generic call
kosmo integrations:call openfda.openfda_device_recall '{}' --json
Shortcut
kosmo integrations:openfda openfda_device_recall '{}' --json

openfda.openfda_device_registrationlisting

Query device establishment registration and listing records.

Read read
Parameters
none
Generic call
kosmo integrations:call openfda.openfda_device_registrationlisting '{}' --json
Shortcut
kosmo integrations:openfda openfda_device_registrationlisting '{}' --json

openfda.openfda_device_udi

Query GUDID device identification records.

Read read
Parameters
none
Generic call
kosmo integrations:call openfda.openfda_device_udi '{}' --json
Shortcut
kosmo integrations:openfda openfda_device_udi '{}' --json

openfda.openfda_device_covid19_serology

Query COVID-19 serology test evaluations.

Read read
Parameters
none
Generic call
kosmo integrations:call openfda.openfda_device_covid19_serology '{}' --json
Shortcut
kosmo integrations:openfda openfda_device_covid19_serology '{}' --json

openfda.openfda_food_enforcement

Query food recall enforcement reports.

Read read
Parameters
none
Generic call
kosmo integrations:call openfda.openfda_food_enforcement '{}' --json
Shortcut
kosmo integrations:openfda openfda_food_enforcement '{}' --json

openfda.openfda_food_event

Query CAERS food, dietary supplement, and cosmetic adverse event reports.

Read read
Parameters
none
Generic call
kosmo integrations:call openfda.openfda_food_event '{}' --json
Shortcut
kosmo integrations:openfda openfda_food_event '{}' --json

openfda.openfda_animal_veterinary_event

Query animal and veterinary adverse event reports.

Read read
Parameters
none
Generic call
kosmo integrations:call openfda.openfda_animal_veterinary_event '{}' --json
Shortcut
kosmo integrations:openfda openfda_animal_veterinary_event '{}' --json

openfda.openfda_cosmetic_event

Query cosmetic adverse event reports.

Read read
Parameters
none
Generic call
kosmo integrations:call openfda.openfda_cosmetic_event '{}' --json
Shortcut
kosmo integrations:openfda openfda_cosmetic_event '{}' --json

openfda.openfda_tobacco_problem

Query tobacco product problem reports.

Read read
Parameters
none
Generic call
kosmo integrations:call openfda.openfda_tobacco_problem '{}' --json
Shortcut
kosmo integrations:openfda openfda_tobacco_problem '{}' --json

openfda.openfda_other_nsde

Query National Substance Data Exchange records.

Read read
Parameters
none
Generic call
kosmo integrations:call openfda.openfda_other_nsde '{}' --json
Shortcut
kosmo integrations:openfda openfda_other_nsde '{}' --json

openfda.openfda_other_substance

Query FDA substance records.

Read read
Parameters
none
Generic call
kosmo integrations:call openfda.openfda_other_substance '{}' --json
Shortcut
kosmo integrations:openfda openfda_other_substance '{}' --json

openfda.openfda_other_unii

Query Unique Ingredient Identifier records.

Read read
Parameters
none
Generic call
kosmo integrations:call openfda.openfda_other_unii '{}' --json
Shortcut
kosmo integrations:openfda openfda_other_unii '{}' --json

openfda.openfda_other_historicaldocument

Query openFDA historical documents.

Read read
Parameters
none
Generic call
kosmo integrations:call openfda.openfda_other_historicaldocument '{}' --json
Shortcut
kosmo integrations:openfda openfda_other_historicaldocument '{}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

openfda.openfda_drug_event 0 parameters
Schema command
kosmo integrations:schema openfda.openfda_drug_event --json
ParameterTypeRequiredDescription
No parameters.
openfda.openfda_drug_label 0 parameters
Schema command
kosmo integrations:schema openfda.openfda_drug_label --json
ParameterTypeRequiredDescription
No parameters.
openfda.openfda_drug_enforcement 0 parameters
Schema command
kosmo integrations:schema openfda.openfda_drug_enforcement --json
ParameterTypeRequiredDescription
No parameters.
openfda.openfda_drug_ndc 0 parameters
Schema command
kosmo integrations:schema openfda.openfda_drug_ndc --json
ParameterTypeRequiredDescription
No parameters.
openfda.openfda_drug_drugsfda 0 parameters
Schema command
kosmo integrations:schema openfda.openfda_drug_drugsfda --json
ParameterTypeRequiredDescription
No parameters.
openfda.openfda_drug_shortages 0 parameters
Schema command
kosmo integrations:schema openfda.openfda_drug_shortages --json
ParameterTypeRequiredDescription
No parameters.
openfda.openfda_device_510k 0 parameters
Schema command
kosmo integrations:schema openfda.openfda_device_510k --json
ParameterTypeRequiredDescription
No parameters.
openfda.openfda_device_classification 0 parameters
Schema command
kosmo integrations:schema openfda.openfda_device_classification --json
ParameterTypeRequiredDescription
No parameters.
openfda.openfda_device_enforcement 0 parameters
Schema command
kosmo integrations:schema openfda.openfda_device_enforcement --json
ParameterTypeRequiredDescription
No parameters.
openfda.openfda_device_event 0 parameters
Schema command
kosmo integrations:schema openfda.openfda_device_event --json
ParameterTypeRequiredDescription
No parameters.
openfda.openfda_device_pma 0 parameters
Schema command
kosmo integrations:schema openfda.openfda_device_pma --json
ParameterTypeRequiredDescription
No parameters.
openfda.openfda_device_recall 0 parameters
Schema command
kosmo integrations:schema openfda.openfda_device_recall --json
ParameterTypeRequiredDescription
No parameters.
openfda.openfda_device_registrationlisting 0 parameters
Schema command
kosmo integrations:schema openfda.openfda_device_registrationlisting --json
ParameterTypeRequiredDescription
No parameters.
openfda.openfda_device_udi 0 parameters
Schema command
kosmo integrations:schema openfda.openfda_device_udi --json
ParameterTypeRequiredDescription
No parameters.
openfda.openfda_device_covid19_serology 0 parameters
Schema command
kosmo integrations:schema openfda.openfda_device_covid19_serology --json
ParameterTypeRequiredDescription
No parameters.
openfda.openfda_food_enforcement 0 parameters
Schema command
kosmo integrations:schema openfda.openfda_food_enforcement --json
ParameterTypeRequiredDescription
No parameters.
openfda.openfda_food_event 0 parameters
Schema command
kosmo integrations:schema openfda.openfda_food_event --json
ParameterTypeRequiredDescription
No parameters.
openfda.openfda_animal_veterinary_event 0 parameters
Schema command
kosmo integrations:schema openfda.openfda_animal_veterinary_event --json
ParameterTypeRequiredDescription
No parameters.
openfda.openfda_cosmetic_event 0 parameters
Schema command
kosmo integrations:schema openfda.openfda_cosmetic_event --json
ParameterTypeRequiredDescription
No parameters.
openfda.openfda_tobacco_problem 0 parameters
Schema command
kosmo integrations:schema openfda.openfda_tobacco_problem --json
ParameterTypeRequiredDescription
No parameters.
openfda.openfda_other_nsde 0 parameters
Schema command
kosmo integrations:schema openfda.openfda_other_nsde --json
ParameterTypeRequiredDescription
No parameters.
openfda.openfda_other_substance 0 parameters
Schema command
kosmo integrations:schema openfda.openfda_other_substance --json
ParameterTypeRequiredDescription
No parameters.
openfda.openfda_other_unii 0 parameters
Schema command
kosmo integrations:schema openfda.openfda_other_unii --json
ParameterTypeRequiredDescription
No parameters.
openfda.openfda_other_historicaldocument 0 parameters
Schema command
kosmo integrations:schema openfda.openfda_other_historicaldocument --json
ParameterTypeRequiredDescription
No parameters.

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.