openfda-mcp-server

v0.8.0 pre-1.0

Query FDA data on drugs, food, devices, and recalls via openFDA. STDIO or Streamable HTTP.

openfda.caseyjhand.com/mcp
claude mcp add --transport http openfda-mcp-server https://openfda.caseyjhand.com/mcp
codex mcp add openfda-mcp-server --url https://openfda.caseyjhand.com/mcp
{
  "mcpServers": {
    "openfda-mcp-server": {
      "url": "https://openfda.caseyjhand.com/mcp"
    }
  }
}
gemini mcp add --transport http openfda-mcp-server https://openfda.caseyjhand.com/mcp
{
  "mcpServers": {
    "openfda-mcp-server": {
      "command": "bunx",
      "args": [
        "mcp-remote",
        "https://openfda.caseyjhand.com/mcp"
      ]
    }
  }
}
{
  "mcpServers": {
    "openfda-mcp-server": {
      "type": "http",
      "url": "https://openfda.caseyjhand.com/mcp"
    }
  }
}
curl -X POST https://openfda.caseyjhand.com/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"curl","version":"1.0.0"}}}'

Tools

15

read 14

openfda_search_adverse_events

Search adverse event reports across drugs, food, and devices. Use to investigate safety signals, find reports for a specific product, or explore reactions by demographics. With stage=true, call openfda_dataframe_describe for the staged columns, then openfda_dataframe_query for SQL.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "openfda_search_adverse_events",
    "arguments": {
      "category": "<category>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "category": {
      "type": "string",
      "enum": [
        "drug",
        "food",
        "device"
      ],
      "description": "Product category — each has different field schemas in the response"
    },
    "search": {
      "description": "openFDA search query. Examples: patient.drug.medicinalproduct:\"aspirin\", patient.reaction.reactionmeddrapt:\"nausea\" AND serious:\"1\". Omit to browse recent. Double quotes, parentheses, and range brackets must balance, and the query must not end on a backslash — each is rejected before the request.",
      "type": "string",
      "minLength": 1,
      "pattern": "\\S"
    },
    "sort": {
      "description": "Sort expression — a field path optionally suffixed with :asc or :desc; comma-separate for multi-field sort. Field paths take only letters, digits, underscores, and dots; anything else is rejected before the request. Sortable date fields are category-specific: drug → receivedate:desc (or receiptdate), food → date_created:desc (or date_started), device → date_received:desc (or date_of_event). A field from another category (e.g. receivedate on food or device) causes a query error — use the field for this category.",
      "type": "string",
      "minLength": 1,
      "pattern": "^ *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?(?: *, *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?)* *$"
    },
    "limit": {
      "default": 10,
      "description": "Maximum number of records to return (1-1000, default 10). Serialized record size varies by three orders of magnitude across openFDA endpoints, so the page is also bounded by a 24000-byte serialized budget: a page that would overrun it returns fewer records than requested and reports the cut on page_omitted. Whenever any record matched, at least one comes back, however large it measures. Drug reports are by far the largest — a single drug/event report averages tens of kilobytes where a food/event report is a few hundred bytes.",
      "type": "number",
      "minimum": 1,
      "maximum": 1000
    },
    "skip": {
      "default": 0,
      "type": "number",
      "minimum": 0,
      "description": "Number of records to skip for pagination (default 0). openFDA caps pagination at 25000 records; a higher value returns a pagination_limit_reached error."
    },
    "stage": {
      "default": false,
      "description": "Stage the matched set on a DataCanvas for SQL analysis — openfda_dataframe_describe lists the staged columns, openfda_dataframe_query runs the SQL. Default false — the call returns one page for one upstream request. When true, records are also drained onto a canvas table up to a size budget (staged_rows reports how many reached it). Staging is for record-level SQL over a bounded slice; for a distribution over everything that matched, openfda_count_values aggregates server-side in one request. Requires CANVAS_PROVIDER_TYPE=duckdb.",
      "type": "boolean"
    },
    "canvas_id": {
      "description": "Canvas ID returned by a prior stage=true call to this tool or another openFDA search tool (openfda_search_* or openfda_lookup_ndc). Passing one stages this search onto that canvas (same effect as stage=true) so result sets accumulate for cross-table joins. Omit to stage onto a fresh canvas.",
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{10}$"
    }
  },
  "required": [
    "category",
    "limit",
    "skip",
    "stage"
  ],
  "additionalProperties": false
}
view source ↗

openfda_search_animal_events

Search adverse event reports for veterinary drugs and devices submitted to the FDA Center for Veterinary Medicine. Records include animal species, breed, age, weight, drug name and route, adverse reactions (using VeDDRA terminology), and outcome. Use to investigate safety signals for veterinary products, find reports by animal species or drug, or explore reaction patterns. With stage=true, call openfda_dataframe_describe for the staged columns, then openfda_dataframe_query for SQL.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "openfda_search_animal_events",
    "arguments": {}
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "search": {
      "description": "openFDA search query using field:value syntax. Examples: animal.species:\"Dog\", drug.brand_name:\"Bravecto\", reaction.veddra_term_name:\"Vomiting\", serious_ae:\"true\". Omit to browse recent reports. Double quotes, parentheses, and range brackets must balance, and the query must not end on a backslash — each is rejected before the request.",
      "type": "string",
      "minLength": 1,
      "pattern": "\\S"
    },
    "sort": {
      "description": "Sort expression — a field path optionally suffixed with :asc or :desc; comma-separate for multi-field sort. Example: original_receive_date:desc. Field paths take only letters, digits, underscores, and dots; anything else is rejected before the request. A well-formed but non-sortable field still causes a query error — use a documented field name.",
      "type": "string",
      "minLength": 1,
      "pattern": "^ *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?(?: *, *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?)* *$"
    },
    "limit": {
      "default": 10,
      "description": "Maximum number of records to return (1-1000, default 10). Serialized record size varies by three orders of magnitude across openFDA endpoints, so the page is also bounded by a 24000-byte serialized budget: a page that would overrun it returns fewer records than requested and reports the cut on page_omitted. Whenever any record matched, at least one comes back, however large it measures.",
      "type": "number",
      "minimum": 1,
      "maximum": 1000
    },
    "skip": {
      "default": 0,
      "type": "number",
      "minimum": 0,
      "description": "Number of records to skip for pagination (default 0). openFDA caps pagination at 25000 records; a higher value returns a pagination_limit_reached error."
    },
    "stage": {
      "default": false,
      "description": "Stage the matched set on a DataCanvas for SQL analysis — openfda_dataframe_describe lists the staged columns, openfda_dataframe_query runs the SQL. Default false — the call returns one page for one upstream request. When true, records are also drained onto a canvas table up to a size budget (staged_rows reports how many reached it). Staging is for record-level SQL over a bounded slice; for a distribution over everything that matched, openfda_count_values aggregates server-side in one request. Requires CANVAS_PROVIDER_TYPE=duckdb.",
      "type": "boolean"
    },
    "canvas_id": {
      "description": "Canvas ID returned by a prior stage=true call to this tool or another openFDA search tool (openfda_search_* or openfda_lookup_ndc). Passing one stages this search onto that canvas (same effect as stage=true) so result sets accumulate for cross-table joins. Omit to stage onto a fresh canvas.",
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{10}$"
    }
  },
  "required": [
    "limit",
    "skip",
    "stage"
  ],
  "additionalProperties": false
}
view source ↗

openfda_search_drug_shortages

Search FDA drug shortage records. Returns per-product shortage status, availability, therapeutic category, dosage form, manufacturer, and dates. Use to check whether a drug is currently in shortage, find all oncology drugs with supply issues, or retrieve the openfda block (brand_name, product_ndc, rxcui) to chain into openfda_get_drug_label or openfda_lookup_ndc. With stage=true, call openfda_dataframe_describe for the staged columns, then openfda_dataframe_query for SQL.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "openfda_search_drug_shortages",
    "arguments": {}
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "search": {
      "description": "openFDA search query using field:value syntax. Examples: status:\"Current\", therapeutic_category:\"Oncology\", generic_name:\"carboplatin\", company_name:\"pfizer\". Omit to browse all records. Double quotes, parentheses, and range brackets must balance, and the query must not end on a backslash — each is rejected before the request. Call openfda_describe_fields({ endpoint: \"drug/shortages\" }) for the complete field list.",
      "type": "string",
      "minLength": 1,
      "pattern": "\\S"
    },
    "sort": {
      "description": "Sort expression — a field path optionally suffixed with :asc or :desc; comma-separate for multi-field sort. Example: update_date:desc. Field paths take only letters, digits, underscores, and dots; anything else is rejected before the request. A well-formed but non-sortable field still causes a query error — use a documented field name.",
      "type": "string",
      "minLength": 1,
      "pattern": "^ *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?(?: *, *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?)* *$"
    },
    "limit": {
      "default": 10,
      "description": "Maximum number of records to return (1-1000, default 10). Serialized record size varies by three orders of magnitude across openFDA endpoints, so the page is also bounded by a 24000-byte serialized budget: a page that would overrun it returns fewer records than requested and reports the cut on page_omitted. Whenever any record matched, at least one comes back, however large it measures.",
      "type": "number",
      "minimum": 1,
      "maximum": 1000
    },
    "skip": {
      "default": 0,
      "type": "number",
      "minimum": 0,
      "description": "Number of records to skip for pagination (default 0). openFDA caps pagination at 25000 records; a higher value returns a pagination_limit_reached error."
    },
    "stage": {
      "default": false,
      "description": "Stage the matched set on a DataCanvas for SQL analysis — openfda_dataframe_describe lists the staged columns, openfda_dataframe_query runs the SQL. Default false — the call returns one page for one upstream request. When true, records are also drained onto a canvas table up to a size budget (staged_rows reports how many reached it). Staging is for record-level SQL over a bounded slice; for a distribution over everything that matched, openfda_count_values aggregates server-side in one request. Requires CANVAS_PROVIDER_TYPE=duckdb.",
      "type": "boolean"
    },
    "canvas_id": {
      "description": "Canvas ID returned by a prior stage=true call to this tool or another openFDA search tool (openfda_search_* or openfda_lookup_ndc). Passing one stages this search onto that canvas (same effect as stage=true) so result sets accumulate for cross-table joins. Omit to stage onto a fresh canvas.",
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{10}$"
    }
  },
  "required": [
    "limit",
    "skip",
    "stage"
  ],
  "additionalProperties": false
}
view source ↗

openfda_search_recalls

Search enforcement reports and recall actions across drugs, food, and devices. With stage=true, call openfda_dataframe_describe for the staged columns, then openfda_dataframe_query for SQL.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "openfda_search_recalls",
    "arguments": {
      "category": "<category>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "category": {
      "type": "string",
      "enum": [
        "drug",
        "food",
        "device"
      ],
      "description": "Product category"
    },
    "endpoint": {
      "default": "enforcement",
      "description": "Report type. Default enforcement. The recall endpoint is only available for devices.",
      "type": "string",
      "enum": [
        "enforcement",
        "recall"
      ]
    },
    "search": {
      "description": "openFDA search query. Examples: classification:\"Class I\" (also \"Class II\" or \"Class III\"), recalling_firm:\"pfizer\", reason_for_recall:\"undeclared allergen\". Omit to browse recent. Double quotes, parentheses, and range brackets must balance, and the query must not end on a backslash — each is rejected before the request.",
      "type": "string",
      "minLength": 1,
      "pattern": "\\S"
    },
    "sort": {
      "description": "Sort expression — a field path optionally suffixed with :asc or :desc; comma-separate for multi-field sort (e.g. report_date:desc,status.exact:asc). Field paths take only letters, digits, underscores, and dots; anything else is rejected before the request. A well-formed but non-sortable field still causes a query error — use a documented field name.",
      "type": "string",
      "minLength": 1,
      "pattern": "^ *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?(?: *, *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?)* *$"
    },
    "limit": {
      "default": 10,
      "description": "Maximum number of records to return (1-1000, default 10). Serialized record size varies by three orders of magnitude across openFDA endpoints, so the page is also bounded by a 24000-byte serialized budget: a page that would overrun it returns fewer records than requested and reports the cut on page_omitted. Whenever any record matched, at least one comes back, however large it measures. Device records are the largest here — a device enforcement or recall record runs several kilobytes where a drug or food enforcement record is around one.",
      "type": "number",
      "minimum": 1,
      "maximum": 1000
    },
    "skip": {
      "default": 0,
      "type": "number",
      "minimum": 0,
      "description": "Number of records to skip for pagination (default 0). openFDA caps pagination at 25000 records; a higher value returns a pagination_limit_reached error."
    },
    "stage": {
      "default": false,
      "description": "Stage the matched set on a DataCanvas for SQL analysis — openfda_dataframe_describe lists the staged columns, openfda_dataframe_query runs the SQL. Default false — the call returns one page for one upstream request. When true, records are also drained onto a canvas table up to a size budget (staged_rows reports how many reached it). Staging is for record-level SQL over a bounded slice; for a distribution over everything that matched, openfda_count_values aggregates server-side in one request. Requires CANVAS_PROVIDER_TYPE=duckdb.",
      "type": "boolean"
    },
    "canvas_id": {
      "description": "Canvas ID returned by a prior stage=true call to this tool or another openFDA search tool (openfda_search_* or openfda_lookup_ndc). Passing one stages this search onto that canvas (same effect as stage=true) so result sets accumulate for cross-table joins. Omit to stage onto a fresh canvas.",
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{10}$"
    }
  },
  "required": [
    "category",
    "endpoint",
    "limit",
    "skip",
    "stage"
  ],
  "additionalProperties": false
}
view source ↗

openfda_search_tobacco_reports

Search problem reports submitted to the FDA for tobacco products, including e-cigarettes, vaping products, cigarettes, and smokeless tobacco. Reports capture product type, reported health problems (e.g. seizure, chest pain), product problems (e.g. exploding battery), whether a non-user was affected, and submission date. Use to investigate safety signals, find reports by product type, or analyze health effects. With stage=true, call openfda_dataframe_describe for the staged columns, then openfda_dataframe_query for SQL.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "openfda_search_tobacco_reports",
    "arguments": {}
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "search": {
      "description": "openFDA search query using field:value syntax. Examples: tobacco_products:\"Electronic cigarette\", reported_health_problems:\"Seizure\", nonuser_affected:\"Yes\". Omit to browse recent reports. Double quotes, parentheses, and range brackets must balance, and the query must not end on a backslash — each is rejected before the request.",
      "type": "string",
      "minLength": 1,
      "pattern": "\\S"
    },
    "sort": {
      "description": "Sort expression — a field path optionally suffixed with :asc or :desc; comma-separate for multi-field sort. Example: date_submitted:desc. Field paths take only letters, digits, underscores, and dots; anything else is rejected before the request. A well-formed but non-sortable field still causes a query error — use a documented field name.",
      "type": "string",
      "minLength": 1,
      "pattern": "^ *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?(?: *, *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?)* *$"
    },
    "limit": {
      "default": 10,
      "description": "Maximum number of records to return (1-1000, default 10). Serialized record size varies by three orders of magnitude across openFDA endpoints, so the page is also bounded by a 24000-byte serialized budget: a page that would overrun it returns fewer records than requested and reports the cut on page_omitted. Whenever any record matched, at least one comes back, however large it measures.",
      "type": "number",
      "minimum": 1,
      "maximum": 1000
    },
    "skip": {
      "default": 0,
      "type": "number",
      "minimum": 0,
      "description": "Number of records to skip for pagination (default 0). openFDA caps pagination at 25000 records; a higher value returns a pagination_limit_reached error."
    },
    "stage": {
      "default": false,
      "description": "Stage the matched set on a DataCanvas for SQL analysis — openfda_dataframe_describe lists the staged columns, openfda_dataframe_query runs the SQL. Default false — the call returns one page for one upstream request. When true, records are also drained onto a canvas table up to a size budget (staged_rows reports how many reached it). Staging is for record-level SQL over a bounded slice; for a distribution over everything that matched, openfda_count_values aggregates server-side in one request. Requires CANVAS_PROVIDER_TYPE=duckdb.",
      "type": "boolean"
    },
    "canvas_id": {
      "description": "Canvas ID returned by a prior stage=true call to this tool or another openFDA search tool (openfda_search_* or openfda_lookup_ndc). Passing one stages this search onto that canvas (same effect as stage=true) so result sets accumulate for cross-table joins. Omit to stage onto a fresh canvas.",
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{10}$"
    }
  },
  "required": [
    "limit",
    "skip",
    "stage"
  ],
  "additionalProperties": false
}
view source ↗

openfda_count_values

Aggregate and tally unique values for any field across any openFDA endpoint. Returns ranked term-count pairs sorted by count descending. Pair with openfda_search_adverse_events, openfda_search_drug_approvals, openfda_search_device_clearances, openfda_search_recalls, openfda_get_drug_label, or openfda_lookup_ndc when sample records help interpret the aggregates.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "openfda_count_values",
    "arguments": {
      "endpoint": "<endpoint>",
      "count": "<count>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "endpoint": {
      "type": "string",
      "enum": [
        "drug/event",
        "drug/label",
        "drug/enforcement",
        "drug/ndc",
        "drug/drugsfda",
        "drug/shortages",
        "food/event",
        "food/enforcement",
        "device/event",
        "device/510k",
        "device/pma",
        "device/recall",
        "device/enforcement",
        "device/classification",
        "device/registrationlisting",
        "device/udi",
        "device/covid19serology",
        "animalandveterinary/event",
        "tobacco/problem",
        "other/substance"
      ],
      "description": "Full openFDA endpoint path (e.g. \"drug/event\", \"device/classification\")"
    },
    "count": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S",
      "description": "Field to count. openfda_describe_fields gives the verified expression per field as countAs (null = not countable in any form). Otherwise: append .exact for whole-phrase counting of free-text fields (e.g. \"patient.reaction.reactionmeddrapt.exact\"); count identifier fields openFDA already indexes as keywords (product_ndc, application_number, pma_number) bare — .exact on those is rejected as not countable."
    },
    "search": {
      "description": "Filter query to scope the count (e.g. patient.drug.medicinalproduct:\"metformin\"). Omit to count across every record in the endpoint. Double quotes, parentheses, and range brackets must balance, and the query must not end on a backslash — each is rejected before the request.",
      "type": "string",
      "minLength": 1,
      "pattern": "\\S"
    },
    "limit": {
      "default": 100,
      "description": "Number of top terms to return (default 100, max 1000 — openFDA's own count maximum). truncated reports whether more distinct terms exist beyond it, except at the maximum itself, where openFDA offers no way to tell.",
      "type": "number",
      "minimum": 1,
      "maximum": 1000
    }
  },
  "required": [
    "endpoint",
    "count",
    "limit"
  ],
  "additionalProperties": false
}
view source ↗

openfda_describe_fields

Return the searchable field paths for an openFDA endpoint, grouped by category with type and description. Use before constructing a search query to find the correct dotted field path — field names differ per endpoint and are not discoverable from the tool schema alone.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "openfda_describe_fields",
    "arguments": {
      "endpoint": "<endpoint>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "endpoint": {
      "type": "string",
      "enum": [
        "drug/event",
        "drug/label",
        "drug/enforcement",
        "drug/ndc",
        "drug/drugsfda",
        "drug/shortages",
        "food/event",
        "food/enforcement",
        "device/event",
        "device/510k",
        "device/pma",
        "device/recall",
        "device/enforcement",
        "device/classification",
        "device/registrationlisting",
        "device/udi",
        "device/covid19serology",
        "animalandveterinary/event",
        "tobacco/problem",
        "other/substance"
      ],
      "description": "openFDA endpoint to describe (e.g. \"drug/event\", \"drug/shortages\", \"device/510k\"). Must be one of the cataloged endpoints."
    }
  },
  "required": [
    "endpoint"
  ],
  "additionalProperties": false
}
view source ↗

openfda_get_drug_label

Look up FDA drug labeling (package inserts / SPL documents). Check indications, warnings, dosage, contraindications, active ingredients, or any structured label section. A label runs to tens of thousands of tokens, so a page that exceeds the inline budget returns the list of available sections instead; re-call with sections to pull the ones you need.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "openfda_get_drug_label",
    "arguments": {
      "search": "<search>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "search": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S",
      "description": "Query targeting label fields. Examples: openfda.brand_name:\"aspirin\", openfda.generic_name:\"metformin\", openfda.manufacturer_name:\"pfizer\". For a specific revision, pass set_id with the SPL UUID returned in earlier results. Double quotes, parentheses, and range brackets must balance, and the query must not end on a backslash — each is rejected before the request."
    },
    "sort": {
      "description": "Sort expression — a field path optionally suffixed with :asc or :desc; comma-separate for multi-field sort. Example: effective_time:desc. Field paths take only letters, digits, underscores, and dots; anything else is rejected before the request. A well-formed but non-sortable field still causes a query error — use a documented field name.",
      "type": "string",
      "minLength": 1,
      "pattern": "^ *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?(?: *, *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?)* *$"
    },
    "limit": {
      "default": 5,
      "description": "Maximum number of results to return (1-1000). Default 5. Labels are large, and the cost of a sections selection is the section summed across every record on the page — so it scales with this limit. Lower it before widening a selection.",
      "type": "number",
      "minimum": 1,
      "maximum": 1000
    },
    "skip": {
      "default": 0,
      "type": "number",
      "minimum": 0,
      "description": "Number of records to skip for pagination (default 0). openFDA caps pagination at 25000 records; a higher value returns a pagination_limit_reached error."
    },
    "sections": {
      "description": "Label sections to return, e.g. [\"boxed_warning\",\"indications_and_usage\"]. Names come from the outline an oversized page returns, or from openfda_describe_fields. Omit for the whole label — which returns the section outline instead when the page exceeds the inline size budget; an empty list is treated as omitted. A selection is returned whole even when it exceeds that budget, with its serialized size reported on the notice; the outline names a section measured to fit at the requested limit. Sections ending in _table hold SPL table markup: raw in structured results, rendered as Markdown tables in the text output. Metadata (openfda, set_id, id, effective_time, version) is returned either way and counts toward the size.",
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "pattern": "\\S",
        "description": "A top-level label section name."
      }
    }
  },
  "required": [
    "search",
    "limit",
    "skip"
  ],
  "additionalProperties": false
}
view source ↗

openfda_search_drug_approvals

Search the Drugs@FDA database for drug application approvals (NDAs and ANDAs). Returns application details, sponsor info, and full submission history. Pair with openfda_get_drug_label to read the approved label, or openfda_count_values to aggregate by sponsor_name, product_type, or route. With stage=true, call openfda_dataframe_describe for the staged columns, then openfda_dataframe_query for SQL.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "openfda_search_drug_approvals",
    "arguments": {}
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "search": {
      "description": "openFDA search query. Examples: openfda.brand_name:\"humira\", sponsor_name:\"PFIZER\", submissions.submission_type:\"ORIG\" AND submissions.review_priority:\"PRIORITY\". Exact quoted values can be case-sensitive on some fields — sponsor_name is stored uppercase, so use sponsor_name:\"PFIZER\" (a lowercase quoted value returns no matches). Omit to browse recent. Double quotes, parentheses, and range brackets must balance, and the query must not end on a backslash — each is rejected before the request.",
      "type": "string",
      "minLength": 1,
      "pattern": "\\S"
    },
    "sort": {
      "description": "Sort expression — a field path optionally suffixed with :asc or :desc; comma-separate for multi-field sort. Example: submissions.submission_status_date:desc. Field paths take only letters, digits, underscores, and dots; anything else is rejected before the request. A well-formed but non-sortable field still causes a query error — use a documented field name.",
      "type": "string",
      "minLength": 1,
      "pattern": "^ *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?(?: *, *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?)* *$"
    },
    "limit": {
      "default": 10,
      "description": "Maximum number of records to return (1-1000, default 10). Serialized record size varies by three orders of magnitude across openFDA endpoints, so the page is also bounded by a 24000-byte serialized budget: a page that would overrun it returns fewer records than requested and reports the cut on page_omitted. Whenever any record matched, at least one comes back, however large it measures. A record carries its application's whole submission history, so a long-running application is an order of magnitude larger than a recent one.",
      "type": "number",
      "minimum": 1,
      "maximum": 1000
    },
    "skip": {
      "default": 0,
      "type": "number",
      "minimum": 0,
      "description": "Number of records to skip for pagination (default 0). openFDA caps pagination at 25000 records; a higher value returns a pagination_limit_reached error."
    },
    "stage": {
      "default": false,
      "description": "Stage the matched set on a DataCanvas for SQL analysis — openfda_dataframe_describe lists the staged columns, openfda_dataframe_query runs the SQL. Default false — the call returns one page for one upstream request. When true, records are also drained onto a canvas table up to a size budget (staged_rows reports how many reached it). Staging is for record-level SQL over a bounded slice; for a distribution over everything that matched, openfda_count_values aggregates server-side in one request. Requires CANVAS_PROVIDER_TYPE=duckdb.",
      "type": "boolean"
    },
    "canvas_id": {
      "description": "Canvas ID returned by a prior stage=true call to this tool or another openFDA search tool (openfda_search_* or openfda_lookup_ndc). Passing one stages this search onto that canvas (same effect as stage=true) so result sets accumulate for cross-table joins. Omit to stage onto a fresh canvas.",
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{10}$"
    }
  },
  "required": [
    "limit",
    "skip",
    "stage"
  ],
  "additionalProperties": false
}
view source ↗

openfda_search_device_clearances

Search FDA device premarket notifications — 510(k) clearances and PMA approvals. With stage=true, call openfda_dataframe_describe for the staged columns, then openfda_dataframe_query for SQL.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "openfda_search_device_clearances",
    "arguments": {
      "pathway": "<pathway>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "pathway": {
      "type": "string",
      "enum": [
        "510k",
        "pma"
      ],
      "description": "Premarket pathway. 510(k) is the most common; PMA is for higher-risk devices."
    },
    "search": {
      "description": "openFDA search query. Examples: applicant:\"medtronic\", advisory_committee_description:\"cardiovascular\", product_code:\"DXN\", openfda.device_name:\"catheter\". Omit to browse recent. Double quotes, parentheses, and range brackets must balance, and the query must not end on a backslash — each is rejected before the request.",
      "type": "string",
      "minLength": 1,
      "pattern": "\\S"
    },
    "sort": {
      "description": "Sort expression — a field path optionally suffixed with :asc or :desc; comma-separate for multi-field sort. Example: decision_date:desc. Field paths take only letters, digits, underscores, and dots; anything else is rejected before the request. A well-formed but non-sortable field still causes a query error — use a documented field name.",
      "type": "string",
      "minLength": 1,
      "pattern": "^ *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?(?: *, *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?)* *$"
    },
    "limit": {
      "default": 10,
      "description": "Maximum number of records to return (1-1000, default 10). Serialized record size varies by three orders of magnitude across openFDA endpoints, so the page is also bounded by a 24000-byte serialized budget: a page that would overrun it returns fewer records than requested and reports the cut on page_omitted. Whenever any record matched, at least one comes back, however large it measures. A 510(k) record carries a summary narrative and is several times the size of a PMA record.",
      "type": "number",
      "minimum": 1,
      "maximum": 1000
    },
    "skip": {
      "default": 0,
      "type": "number",
      "minimum": 0,
      "description": "Number of records to skip for pagination (default 0). openFDA caps pagination at 25000 records; a higher value returns a pagination_limit_reached error."
    },
    "stage": {
      "default": false,
      "description": "Stage the matched set on a DataCanvas for SQL analysis — openfda_dataframe_describe lists the staged columns, openfda_dataframe_query runs the SQL. Default false — the call returns one page for one upstream request. When true, records are also drained onto a canvas table up to a size budget (staged_rows reports how many reached it). Staging is for record-level SQL over a bounded slice; for a distribution over everything that matched, openfda_count_values aggregates server-side in one request. Requires CANVAS_PROVIDER_TYPE=duckdb.",
      "type": "boolean"
    },
    "canvas_id": {
      "description": "Canvas ID returned by a prior stage=true call to this tool or another openFDA search tool (openfda_search_* or openfda_lookup_ndc). Passing one stages this search onto that canvas (same effect as stage=true) so result sets accumulate for cross-table joins. Omit to stage onto a fresh canvas.",
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{10}$"
    }
  },
  "required": [
    "pathway",
    "limit",
    "skip",
    "stage"
  ],
  "additionalProperties": false
}
view source ↗

openfda_lookup_ndc

Look up drugs in the NDC (National Drug Code) Directory. Identify drug products by NDC code, find active ingredients, packaging details, or manufacturer info. Pair with openfda_get_drug_label using the returned brand_name or set_id to read the package insert. With stage=true, call openfda_dataframe_describe for the staged columns, then openfda_dataframe_query for SQL.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "openfda_lookup_ndc",
    "arguments": {
      "search": "<search>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "search": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S",
      "description": "openFDA search query. Examples: product_ndc:\"0363-0218\", brand_name:\"aspirin\", generic_name:\"metformin\", openfda.manufacturer_name:\"walgreen\", active_ingredients.name:\"ASPIRIN\". Double quotes, parentheses, and range brackets must balance, and the query must not end on a backslash — each is rejected before the request."
    },
    "sort": {
      "description": "Sort expression — a field path optionally suffixed with :asc or :desc; comma-separate for multi-field sort. Example: listing_expiration_date:desc. Field paths take only letters, digits, underscores, and dots; anything else is rejected before the request. A well-formed but non-sortable field still causes a query error — use a documented field name.",
      "type": "string",
      "minLength": 1,
      "pattern": "^ *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?(?: *, *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?)* *$"
    },
    "limit": {
      "default": 10,
      "description": "Maximum number of records to return (1-1000, default 10). Serialized record size varies by three orders of magnitude across openFDA endpoints, so the page is also bounded by a 24000-byte serialized budget: a page that would overrun it returns fewer records than requested and reports the cut on page_omitted. Whenever any record matched, at least one comes back, however large it measures. A record grows with its packaging list, so a product with many package configurations is several times the size of one with a single package.",
      "type": "number",
      "minimum": 1,
      "maximum": 1000
    },
    "skip": {
      "default": 0,
      "type": "number",
      "minimum": 0,
      "description": "Number of records to skip for pagination (default 0). openFDA caps pagination at 25000 records; a higher value returns a pagination_limit_reached error."
    },
    "stage": {
      "default": false,
      "description": "Stage the matched set on a DataCanvas for SQL analysis — openfda_dataframe_describe lists the staged columns, openfda_dataframe_query runs the SQL. Default false — the call returns one page for one upstream request. When true, records are also drained onto a canvas table up to a size budget (staged_rows reports how many reached it). Staging is for record-level SQL over a bounded slice; for a distribution over everything that matched, openfda_count_values aggregates server-side in one request. Requires CANVAS_PROVIDER_TYPE=duckdb.",
      "type": "boolean"
    },
    "canvas_id": {
      "description": "Canvas ID returned by a prior stage=true call to this tool or an openFDA search tool (openfda_search_*). Passing one stages this lookup onto that canvas (same effect as stage=true) so result sets accumulate for cross-table joins. Omit to stage onto a fresh canvas.",
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{10}$"
    }
  },
  "required": [
    "search",
    "limit",
    "skip",
    "stage"
  ],
  "additionalProperties": false
}
view source ↗

openfda_drug_profile

Resolve one drug name to its FDA identity, then fan out in parallel across the bounded per-drug openFDA endpoints and merge into one profile: identity, label highlights, adverse-event summary, recall history, Drugs@FDA approval, and shortage status. Replaces chaining openfda_get_drug_label, openfda_search_adverse_events, openfda_search_recalls, openfda_search_drug_approvals, and openfda_search_drug_shortages — and reconciles the identifier drift between endpoints that makes that chaining error-prone. Each section is best-effort: a miss returns null rather than failing the call. For deep dives into any one area, use the dedicated tool.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "openfda_drug_profile",
    "arguments": {
      "drug": "<drug>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "drug": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S",
      "description": "Drug name to profile — brand or generic (e.g. \"metformin\", \"Humira\", \"Glucophage\"). Resolved once to canonical FDA identifiers, which then key every sub-query."
    }
  },
  "required": [
    "drug"
  ],
  "additionalProperties": false
}
view source ↗

openfda_dataframe_describe

List the tables and column schemas on a DataCanvas staged by an openFDA search tool. Call before openfda_dataframe_query to discover the exact table name, column names, and DuckDB types needed for valid SQL. row_count is the full staged result set, not the inline preview count. Columns typed JSON hold nested openFDA objects/arrays — query them with DuckDB json functions.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "openfda_dataframe_describe",
    "arguments": {
      "canvas_id": "<canvas_id>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "canvas_id": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{10}$",
      "description": "Canvas ID from the canvas_id field of an openFDA search tool response (openfda_search_* or openfda_lookup_ndc), present when the search ran with stage=true."
    }
  },
  "required": [
    "canvas_id"
  ],
  "additionalProperties": false
}
view source ↗

openfda_dataframe_query

Run a read-only SQL SELECT against a DataCanvas table staged by an openFDA search tool (call one with stage=true; its response carries canvas_id + canvas_table). Enables GROUP BY, COUNT/SUM/AVG, time-series, and joins across the staged result set without re-paging the API. Call openfda_dataframe_describe first to get the exact table and column names. Results are capped at the canvas row limit — when truncated is true, page the rest with ORDER BY plus LIMIT/OFFSET. Scalar fields are stored as text (CAST for numeric math); nested objects/arrays are JSON columns — read them with DuckDB json functions, e.g. json_extract_string(openfda, '$.brand_name[0]'). Only SELECT is allowed — DDL, DML, COPY, and file-reading functions are blocked.

read
invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "openfda_dataframe_query",
    "arguments": {
      "canvas_id": "<canvas_id>",
      "query": "<query>"
    }
  }
}
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "canvas_id": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{10}$",
      "description": "Canvas ID from the canvas_id field of an openFDA search tool response (openfda_search_* or openfda_lookup_ndc), present when the search ran with stage=true."
    },
    "query": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S",
      "description": "SQL SELECT against the staged table. Use the table name from openfda_dataframe_describe. Example: \"SELECT classification, COUNT(*) AS n FROM spilled_ab12cd34 GROUP BY classification ORDER BY n DESC\"."
    }
  },
  "required": [
    "canvas_id",
    "query"
  ],
  "additionalProperties": false
}
view source ↗

disabled 1

openfda_dataframe_drop

Delete one table or view from a DataCanvas staged by an openFDA search tool, freeing the space it holds before the canvas expires on its own. Other tables on the canvas, and the canvas itself, stay. The drop is permanent: re-run the search tool with stage=true to stage the data again. Call openfda_dataframe_describe for the exact table name.

disabledwould be destructive

Disabled. Dropping staged DataCanvas tables is turned off in this deployment.

OPENFDA_DATAFRAME_DROP_ENABLED=true
schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "canvas_id": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{10}$",
      "description": "Canvas ID from the canvas_id field of an openFDA search tool response (openfda_search_* or openfda_lookup_ndc), present when the search ran with stage=true."
    },
    "table": {
      "type": "string",
      "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,62}$",
      "description": "Name of the table or view to delete, exactly as openfda_dataframe_describe lists it (e.g. spilled_ab12cd34)."
    }
  },
  "required": [
    "canvas_id",
    "table"
  ],
  "additionalProperties": false
}
view source ↗