openfda-mcp-server
Ce que fait ce MCP
Queries FDA data on drugs, labels, approvals, adverse events, shortages, recalls, devices, food, tobacco, and veterinary products, with aggregation and SQL analysis.
Outils
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['endpoint', 'count'], 'properties': {'count': {'type': 'string', 'pattern': '\\S', 'minLength': 1, '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 â\x80\x94 .exact on those is rejected as not countable.'}, 'limit': {'type': 'number', 'default': 100, 'maximum': 1000, 'minimum': 1, 'description': "Number of top terms to return (default 100, max 1000 â\x80\x94 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."}, 'search': {'type': 'string', 'pattern': '\\S', 'minLength': 1, '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 â\x80\x94 each is rejected before the request.'}, 'endpoint': {'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'], 'type': 'string', 'description': 'Full openFDA endpoint path (e.g. "drug/event", "device/classification")'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['meta', 'results', 'termCount']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'cap': {'type': 'number', 'description': 'The limit applied to the term list.'}, 'meta': {'type': 'object', 'required': ['lastUpdated'], 'properties': {'lastUpdated': {'type': 'string', 'description': 'Dataset last updated date'}}, 'description': 'Response metadata', 'additionalProperties': False}, 'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['rate_limited', 'upstream_error', 'malformed_search', 'query_error', 'not_aggregatable'], 'description': 'Machine-readable failure mode. Declared by this tool: `rate_limited`: The openFDA daily or per-minute request limit is exceeded. `upstream_error`: The openFDA API returned a 5xx server error. `malformed_search`: The search query leaves a double quote, parenthesis, or range bracket unclosed, or ends on a backslash. `query_error`: The search or count query was rejected by openFDA (malformed field name, invalid syntax). `not_aggregatable`: openFDA cannot aggregate the count expression as written â\x80\x94 an analyzed text field, .exact on a field already indexed as a keyword, or a field with no countable form. Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'shown': {'type': 'number', 'description': 'Number of terms returned in this response.'}, 'notice': {'type': 'string', 'description': 'Why the tally is empty â\x80\x94 the search matched no records, or the matched records carry no value for the field â\x80\x94 and how to widen it; when truncated, how to reach the omitted terms; at the 1000-term maximum, that openFDA cannot show whether more distinct values exist. Absent when a complete list is returned.'}, 'results': {'type': 'array', 'items': {'type': 'object', 'required': ['term', 'count'], 'properties': {'term': {'type': 'string', 'description': 'Field value'}, 'count': {'type': 'number', 'description': 'Number of occurrences'}}, 'description': 'A single term-count pair', 'additionalProperties': False}, 'description': 'Term-count pairs sorted by count descending'}, 'termCount': {'type': 'number', 'description': 'Number of distinct terms returned'}, 'truncated': {'type': 'boolean', 'description': 'True when at least one more distinct term exists beyond the limit. Absent when the list is complete, and at the 1000-term maximum, where openFDA cannot show whether more exist (notice says so).'}, 'truncationCeiling': {'type': 'number', 'description': 'Count of the lowest-ranked term returned â\x80\x94 omitted terms fall at or below it.'}}, 'additionalProperties': False}
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['canvas_id'], '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.'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['tables', 'canvas_id']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['canvas_disabled', 'canvas_not_found'], 'description': 'Machine-readable failure mode. Declared by this tool: `canvas_disabled`: DataCanvas is disabled â\x80\x94 CANVAS_PROVIDER_TYPE is unset. `canvas_not_found`: The canvas_id does not correspond to an active canvas session. Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'tables': {'type': 'array', 'items': {'type': 'object', 'required': ['name', 'kind', 'row_count', 'columns'], 'properties': {'kind': {'type': 'string', 'description': 'Object type: "table" for staged data, "view" for a derived view.'}, 'name': {'type': 'string', 'description': 'Table or view name â\x80\x94 use verbatim in SQL FROM clauses.'}, 'columns': {'type': 'array', 'items': {'type': 'object', 'required': ['name', 'type'], 'properties': {'name': {'type': 'string', 'description': 'Column name â\x80\x94 use in SELECT, WHERE, GROUP BY, ORDER BY.'}, 'type': {'type': 'string', 'description': 'DuckDB type (VARCHAR, JSON, BIGINT, DOUBLE, BOOLEAN, ...).'}, 'nullable': {'type': 'boolean', 'description': 'True when the column may contain NULL. Absent when unknown.'}}, 'description': 'A single column in the table.', 'additionalProperties': False}, 'description': 'All columns in this table, in schema order.'}, 'row_count': {'type': 'number', 'description': 'Total rows in this table â\x80\x94 the full staged set, not the inline preview.'}}, 'description': 'A registered table or view on the canvas.', 'additionalProperties': False}, 'description': 'All tables and views available on this canvas.'}, 'canvas_id': {'type': 'string', 'description': 'Canvas ID that was described â\x80\x94 pass to openfda_dataframe_query.'}}, 'additionalProperties': False}
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['canvas_id', 'query'], 'properties': {'query': {'type': 'string', 'pattern': '\\S', 'minLength': 1, '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".'}, '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.'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['rows', 'row_count', 'truncated', 'canvas_id']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'rows': {'type': 'array', 'items': {'type': 'object', 'description': 'A result row â\x80\x94 keys are the SELECT column names, values the computed data.', 'propertyNames': {'type': 'string'}, 'additionalProperties': {}}, 'description': 'Rows returned by the query (capped at the canvas row limit).'}, 'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['canvas_disabled', 'canvas_not_found', 'missing_table', 'invalid_query'], 'description': 'Machine-readable failure mode. Declared by this tool: `canvas_disabled`: DataCanvas is disabled â\x80\x94 CANVAS_PROVIDER_TYPE is unset. `canvas_not_found`: The canvas_id does not correspond to an active canvas session. `missing_table`: The SQL references a table that is not on the canvas â\x80\x94 dropped, expired, or mistyped. `invalid_query`: The SQL is not a valid SELECT, references an unknown column, uses a blocked operation, or fails on a staged value (a CAST that does not convert). Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'canvas_id': {'type': 'string', 'description': 'Canvas ID that was queried â\x80\x94 reuse for follow-up queries.'}, 'row_count': {'type': 'number', 'description': 'Number of rows in this response. Equals the canvas row limit when truncated is true.'}, 'truncated': {'type': 'boolean', 'description': 'True when the result hit the canvas row limit and rows beyond it were dropped. Page the rest with ORDER BY plus LIMIT/OFFSET.'}}, 'additionalProperties': False}
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['endpoint'], 'properties': {'endpoint': {'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'], 'type': 'string', 'description': 'openFDA endpoint to describe (e.g. "drug/event", "drug/shortages", "device/510k"). Must be one of the cataloged endpoints.'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['endpoint', 'groups', 'queryTips']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'description': 'Machine-readable failure mode.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'groups': {'type': 'array', 'items': {'type': 'object', 'required': ['label', 'fields'], 'properties': {'label': {'type': 'string', 'description': 'Field group label'}, 'fields': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'type', 'countAs', 'note'], 'properties': {'note': {'type': 'string', 'description': 'What this field contains'}, 'path': {'type': 'string', 'description': 'Dotted field path for use in search queries'}, 'type': {'type': 'string', 'description': 'Data type (string, date, integer, float, boolean)'}, 'countAs': {'type': ['string', 'null'], 'description': 'Verified expression to pass as count in openfda_count_values (the bare path or path.exact); null when openFDA cannot aggregate the field in any form'}}, 'description': 'A single searchable field entry', 'additionalProperties': False}, 'description': 'Searchable fields in this group'}}, 'description': 'A named group of related fields', 'additionalProperties': False}, 'description': 'Field groups for this endpoint'}, 'endpoint': {'type': 'string', 'description': 'The endpoint these fields apply to'}, 'queryTips': {'type': 'string', 'description': 'openFDA query syntax reminders relevant to this endpoint'}}, 'additionalProperties': False}
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['drug'], 'properties': {'drug': {'type': 'string', 'pattern': '\\S', 'minLength': 1, 'description': 'Drug name to profile â\x80\x94 brand or generic (e.g. "metformin", "Humira", "Glucophage"). Resolved once to canonical FDA identifiers, which then key every sub-query.'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['meta', 'identity', 'label', 'adverse_events', 'recalls', 'approval', 'shortage', 'degraded', 'sectionsFound']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'meta': {'type': 'object', 'required': ['drug', 'resolvedVia', 'fanOutKey'], 'properties': {'drug': {'type': 'string', 'description': 'The drug name supplied in the request, echoed back.'}, 'fanOutKey': {'type': 'string', 'description': 'Canonical key the structured sub-queries (recall/enforcement, Drugs@FDA approval, shortage) ran against â\x80\x94 the resolved generic name, falling back to a brand name, then the input term. The adverse-event sub-query instead keys off the raw input term to match heterogeneous reporter-entered values.'}, 'resolvedVia': {'enum': ['label', 'ndc', 'none'], 'type': 'string', 'description': 'Which endpoint resolved the canonical identity: drug/label, drug/ndc, or none.'}}, 'description': 'Request metadata.', 'additionalProperties': False}, 'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['blank_drug_name'], 'description': 'Machine-readable failure mode. Declared by this tool: `blank_drug_name`: The drug name carries no searchable character â\x80\x94 only quotes, backslashes, or whitespace. Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'label': {'anyOf': [{'type': 'object', 'required': ['indications', 'warnings', 'dosage'], 'properties': {'dosage': {'type': ['string', 'null'], 'description': 'Dosage and administration (truncated).'}, 'warnings': {'type': ['string', 'null'], 'description': 'Warnings (truncated) â\x80\x94 boxed warning or warnings_and_cautions for Rx labels, falling back to the OTC-monograph warnings section.'}, 'indications': {'type': ['string', 'null'], 'description': 'Indications and usage (truncated).'}}, 'additionalProperties': False}, {'type': 'null'}], 'description': 'Label highlights from drug/label, or null when no label matched.'}, 'notice': {'type': 'string', 'description': 'Guidance when the drug could not be resolved or upstream errors degraded the profile. Absent on a fully populated profile.'}, 'recalls': {'type': 'array', 'items': {'type': 'object', 'required': ['classification', 'reason', 'recalling_firm', 'date'], 'properties': {'date': {'type': ['string', 'null'], 'description': 'Recall initiation or report date (YYYYMMDD).'}, 'reason': {'type': ['string', 'null'], 'description': 'Reason for recall (truncated).'}, 'classification': {'type': ['string', 'null'], 'description': 'Recall hazard class (Class I/II/III).'}, 'recalling_firm': {'type': ['string', 'null'], 'description': 'Firm conducting the recall.'}}, 'description': 'A single recall or enforcement action.', 'additionalProperties': False}, 'description': 'Recent drug/enforcement recall actions (may be empty).'}, 'approval': {'anyOf': [{'type': 'object', 'required': ['applicationNumber', 'sponsor', 'marketingStatus'], 'properties': {'sponsor': {'type': ['string', 'null'], 'description': 'Sponsor/applicant name.'}, 'marketingStatus': {'type': ['string', 'null'], 'description': 'Derived marketing/approval status.'}, 'applicationNumber': {'type': ['string', 'null'], 'description': 'NDA/ANDA application number.'}}, 'additionalProperties': False}, {'type': 'null'}], 'description': 'Drugs@FDA approval summary, or null when no application matched.'}, 'degraded': {'type': 'array', 'items': {'type': 'object', 'required': ['section', 'reason', 'message'], 'properties': {'reason': {'type': 'string', 'description': 'Machine-readable failure reason (e.g. rate_limited, upstream_error, query_error).'}, 'message': {'type': 'string', 'description': 'Upstream failure message for this section, truncated.'}, 'section': {'enum': ['identity', 'label', 'adverse_events', 'recalls', 'approval', 'shortage'], 'type': 'string', 'description': 'Profile section whose sub-query failed.'}}, 'description': 'One failed sub-query and why it failed.', 'additionalProperties': False}, 'description': 'Sub-queries that failed upstream, empty when every section resolved. A section listed here is unknown, not absent â\x80\x94 a null section with no entry here genuinely has no FDA record.'}, 'identity': {'type': 'object', 'required': ['brand_names', 'generic_name', 'product_ndc', 'rxcui', 'spl_set_id'], 'properties': {'rxcui': {'type': ['string', 'null'], 'description': 'RxNorm concept unique identifier, when available.'}, 'spl_set_id': {'type': ['string', 'null'], 'description': 'SPL set ID for the drug label, when available.'}, 'brand_names': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Brand names for the drug (openfda.brand_name).'}, 'product_ndc': {'type': ['string', 'null'], 'description': 'Representative product NDC, when available.'}, 'generic_name': {'type': ['string', 'null'], 'description': 'Canonical generic name (openfda.generic_name) â\x80\x94 the primary source for meta.fanOutKey.'}}, 'description': 'Identity resolved once and reused across every sub-query to avoid identifier drift.', 'additionalProperties': False}, 'shortage': {'anyOf': [{'type': 'object', 'required': ['status', 'availability'], 'properties': {'status': {'type': ['string', 'null'], 'description': 'Shortage status (Current/Resolved).'}, 'availability': {'type': ['string', 'null'], 'description': 'Availability note (truncated).'}}, 'additionalProperties': False}, {'type': 'null'}], 'description': 'Current or most-recent drug shortage status, or null when none on record.'}, 'sectionsFound': {'type': 'number', 'description': 'How many profile sections (label, adverse_events, recalls, approval, shortage) returned data.'}, 'adverse_events': {'anyOf': [{'type': 'object', 'required': ['total', 'seriousCount', 'topReactions'], 'properties': {'total': {'type': 'number', 'description': 'Approximate total adverse-event reports naming this drug.'}, 'seriousCount': {'type': 'number', 'description': 'Reports flagged serious (serious=1).'}, 'topReactions': {'type': 'array', 'items': {'type': 'object', 'required': ['term', 'count'], 'properties': {'term': {'type': 'string', 'description': 'MedDRA reaction term.'}, 'count': {'type': 'number', 'description': 'Reports citing this reaction.'}}, 'description': 'A reaction term paired with its report count.', 'additionalProperties': False}, 'description': 'Most-frequent reported reactions, descending.'}}, 'additionalProperties': False}, {'type': 'null'}], 'description': 'Adverse-event summary aggregated over drug/event, or null when unavailable.'}}, 'additionalProperties': False}
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['search'], 'properties': {'skip': {'type': 'number', 'default': 0, '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.'}, 'sort': {'type': 'string', 'pattern': '^ *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?(?: *, *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?)* *$', 'minLength': 1, 'description': 'Sort expression â\x80\x94 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 â\x80\x94 use a documented field name.'}, 'limit': {'type': 'number', 'default': 5, 'maximum': 1000, 'minimum': 1, '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 â\x80\x94 so it scales with this limit. Lower it before widening a selection.'}, 'search': {'type': 'string', 'pattern': '\\S', 'minLength': 1, '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 â\x80\x94 each is rejected before the request.'}, 'sections': {'type': 'array', 'items': {'type': 'string', 'pattern': '\\S', 'minLength': 1, 'description': 'A top-level label section name.'}, '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 â\x80\x94 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.'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['meta', 'kind', 'totalResults', 'effectiveQuery']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'cap': {'type': 'number', 'description': 'The limit applied to this page.'}, 'kind': {'enum': ['full', 'outline'], 'type': 'string', 'description': 'Whether this response carries label records ("full") or only the section outline of a page too large to inline ("outline").'}, 'meta': {'type': 'object', 'required': ['total', 'skip', 'limit', 'lastUpdated'], 'properties': {'skip': {'type': 'number', 'description': 'Number of results skipped.'}, 'limit': {'type': 'number', 'description': 'Maximum results returned per request.'}, 'total': {'type': 'number', 'description': 'Total matching results in the dataset.'}, 'lastUpdated': {'type': 'string', 'description': 'Date the dataset was last updated.'}, 'totalUnverified': {'type': 'boolean', 'description': 'Present (true) only on an empty page at skip > 0 whose total could not be confirmed: openFDA answers a page past the end and a search that matched nothing alike, and the follow-up request for the total failed. total then reads 0 without ruling out records at a lower skip â\x80\x94 re-call with skip=0 to tell.'}}, 'description': 'Pagination and freshness metadata.', 'additionalProperties': False}, 'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['rate_limited', 'upstream_error', 'malformed_search', 'query_error', 'pagination_limit_reached'], 'description': 'Machine-readable failure mode. Declared by this tool: `rate_limited`: The openFDA daily or per-minute request limit is exceeded. `upstream_error`: The openFDA API returned a 5xx server error. `malformed_search`: The search query leaves a double quote, parenthesis, or range bracket unclosed, or ends on a backslash. `query_error`: The search query was rejected by openFDA (malformed field name, invalid syntax). `pagination_limit_reached`: skip exceeds the 25000 record pagination ceiling. Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'shown': {'type': 'number', 'description': 'Number of labels returned in this response.'}, 'notice': {'type': 'string', 'description': 'Guidance for this page: how to broaden filters or correct field names when results are empty or paging overshot, the sized re-call example when a page overflowed to its section outline, section names no record carried, and the serialized size when a sections selection exceeds the inline budget. Absent when nothing needs saying.'}, 'outline': {'type': 'array', 'items': {'type': 'object', 'required': ['name', 'bytes'], 'properties': {'name': {'type': 'string', 'description': 'Section identifier â\x80\x94 pass in `sections` to retrieve it'}, 'bytes': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': 0, 'description': 'Serialized byte size of the section'}}, 'description': 'One retrievable label section and its serialized size.', 'additionalProperties': False}, 'description': 'Section names available across the matched page and their serialized size, largest first. Present when kind is "outline" â\x80\x94 pass names back in sections to retrieve them.'}, 'results': {'type': 'array', 'items': {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {}}, 'description': 'Drug label records, present when kind is "full". Each carries an openfda block (brand_name, generic_name, manufacturer_name, route) plus optional SPL sections like indications_and_usage, warnings, dosage_and_administration, contraindications, adverse_reactions; section presence varies per label. Sections ending in _table carry raw SPL table markup (tags and character entities) exactly as openFDA returns it. Narrowed to the requested sections plus metadata when sections was supplied.'}, 'truncated': {'type': 'boolean', 'description': 'True when more labels matched than this page returned â\x80\x94 page with skip for the rest.'}, 'totalResults': {'type': 'number', 'description': 'Total matching label records in the dataset'}, 'effectiveQuery': {'type': 'string', 'description': 'Search filter applied to the drug label query, as submitted to openFDA'}}, 'additionalProperties': False}
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['search'], 'properties': {'skip': {'type': 'number', 'default': 0, '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.'}, 'sort': {'type': 'string', 'pattern': '^ *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?(?: *, *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?)* *$', 'minLength': 1, 'description': 'Sort expression â\x80\x94 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 â\x80\x94 use a documented field name.'}, 'limit': {'type': 'number', 'default': 10, 'maximum': 1000, 'minimum': 1, '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.'}, 'stage': {'type': 'boolean', 'default': False, 'description': 'Stage the matched set on a DataCanvas for SQL analysis â\x80\x94 openfda_dataframe_describe lists the staged columns, openfda_dataframe_query runs the SQL. Default false â\x80\x94 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.'}, 'search': {'type': 'string', 'pattern': '\\S', 'minLength': 1, '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 â\x80\x94 each is rejected before the request.'}, 'canvas_id': {'type': 'string', 'pattern': '^[A-Za-z0-9_-]{10}$', '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.'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['meta', 'results', 'totalResults', 'effectiveQuery']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'meta': {'type': 'object', 'required': ['total', 'skip', 'limit', 'lastUpdated'], 'properties': {'skip': {'type': 'number', 'description': 'Pagination offset'}, 'limit': {'type': 'number', 'description': 'Page size applied to this request â\x80\x94 the requested limit, lowered to the records returned when the 24000-byte inline budget bounded the page (see page_omitted). Not a count of what arrived: a window running past the end of the matched set returns fewer records than this, so read the length of results for the actual count.'}, 'total': {'type': 'number', 'description': 'Total matching records'}, 'lastUpdated': {'type': 'string', 'description': 'Dataset last updated date'}, 'totalUnverified': {'type': 'boolean', 'description': 'Present (true) only on an empty page at skip > 0 whose total could not be confirmed: openFDA answers a page past the end and a search that matched nothing alike, and the follow-up request for the total failed. total then reads 0 without ruling out records at a lower skip â\x80\x94 re-call with skip=0 to tell.'}}, 'description': 'Response metadata', 'additionalProperties': False}, 'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['canvas_disabled', 'canvas_not_found', 'canvas_capacity_exhausted', 'rate_limited', 'upstream_error', 'malformed_search', 'query_error', 'pagination_limit_reached'], 'description': 'Machine-readable failure mode. Declared by this tool: `canvas_disabled`: Staging was requested (stage=true or a canvas_id) but DataCanvas is disabled. `canvas_not_found`: The canvas_id is well-formed but names no active canvas â\x80\x94 expired or never minted. `canvas_capacity_exhausted`: canvas_id was omitted and the active canvas cap is already reached. `rate_limited`: The openFDA daily or per-minute request limit is exceeded. `upstream_error`: The openFDA API returned a 5xx server error. `malformed_search`: The search query leaves a double quote, parenthesis, or range bracket unclosed, or ends on a backslash. `query_error`: The search query was rejected by openFDA (malformed field name, invalid syntax). `pagination_limit_reached`: skip exceeds the 25000 record pagination ceiling. Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'notice': {'type': 'string', 'description': 'Canvas staging disclosure when the call staged, the byte-budget disclosure and the routes to the withheld records when the inline page was bounded, and guidance when results are empty â\x80\x94 how to broaden filters or correct field names.'}, 'results': {'type': 'array', 'items': {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {}}, 'description': 'NDC directory records â\x80\x94 product_ndc, brand_name, generic_name, labeler_name, dosage_form, route, marketing_category, active_ingredients[], packaging[], listing_expiration_date.'}, 'spilled': {'type': 'boolean', 'description': 'True when this call staged its matched set on the canvas â\x80\x94 use canvas_id with openfda_dataframe_describe for its columns, then openfda_dataframe_query for SQL. Absent when staging was not requested.'}, 'canvas_id': {'type': 'string', 'description': 'DataCanvas session id for the staged result set. Present when this call staged. Pass to openfda_dataframe_query / openfda_dataframe_describe, or back into this tool to accumulate more tables on the same canvas.'}, 'truncated': {'type': 'boolean', 'description': "True when fewer rows reached the canvas than matched upstream â\x80\x94 staging stopped at its size budget or openFDA's 25000-row pagination ceiling. Narrow the query (filters, date range) for a complete set."}, 'page_bytes': {'type': 'number', 'description': 'Serialized size of results in this response, in bytes. Present only when the 24000-byte inline budget bounded the page; larger than the budget only when a single record exceeds it on its own.'}, 'staged_rows': {'type': 'number', 'description': 'Rows written to the canvas table. Compare with meta.total: a smaller value means staging stopped at its size budget and the table holds only the first staged_rows records.'}, 'canvas_table': {'type': 'string', 'description': 'Canvas table holding the staged rows. Present when rows were staged; list its columns with openfda_dataframe_describe, then reference it in openfda_dataframe_query FROM clauses.'}, 'page_omitted': {'type': 'number', 'description': 'Records dropped from the requested limit/skip window so the page fit the inline byte budget. Present only when the page was bounded. Read them by re-calling with skip advanced by the number of records returned, lower limit for a smaller page, or pass stage=true to query a bounded drain of the match with openfda_dataframe_query.'}, 'totalResults': {'type': 'number', 'description': 'Total matching NDC records in the dataset'}, 'effectiveQuery': {'type': 'string', 'description': 'Search filter applied to the NDC lookup, as submitted to openFDA'}}, 'additionalProperties': False}
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['category'], 'properties': {'skip': {'type': 'number', 'default': 0, '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.'}, 'sort': {'type': 'string', 'pattern': '^ *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?(?: *, *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?)* *$', 'minLength': 1, 'description': 'Sort expression â\x80\x94 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 â\x86\x92 receivedate:desc (or receiptdate), food â\x86\x92 date_created:desc (or date_started), device â\x86\x92 date_received:desc (or date_of_event). A field from another category (e.g. receivedate on food or device) causes a query error â\x80\x94 use the field for this category.'}, 'limit': {'type': 'number', 'default': 10, 'maximum': 1000, 'minimum': 1, '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 â\x80\x94 a single drug/event report averages tens of kilobytes where a food/event report is a few hundred bytes.'}, 'stage': {'type': 'boolean', 'default': False, 'description': 'Stage the matched set on a DataCanvas for SQL analysis â\x80\x94 openfda_dataframe_describe lists the staged columns, openfda_dataframe_query runs the SQL. Default false â\x80\x94 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.'}, 'search': {'type': 'string', 'pattern': '\\S', 'minLength': 1, '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 â\x80\x94 each is rejected before the request.'}, 'category': {'enum': ['drug', 'food', 'device'], 'type': 'string', 'description': 'Product category â\x80\x94 each has different field schemas in the response'}, 'canvas_id': {'type': 'string', 'pattern': '^[A-Za-z0-9_-]{10}$', '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.'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['meta', 'results', 'totalResults']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'meta': {'type': 'object', 'required': ['total', 'skip', 'limit', 'lastUpdated'], 'properties': {'skip': {'type': 'number', 'description': 'Pagination offset'}, 'limit': {'type': 'number', 'description': 'Page size applied to this request â\x80\x94 the requested limit, lowered to the records returned when the 24000-byte inline budget bounded the page (see page_omitted). Not a count of what arrived: a window running past the end of the matched set returns fewer records than this, so read the length of results for the actual count.'}, 'total': {'type': 'number', 'description': 'Total matching records in the database'}, 'lastUpdated': {'type': 'string', 'description': 'Dataset last updated date'}, 'totalUnverified': {'type': 'boolean', 'description': 'Present (true) only on an empty page at skip > 0 whose total could not be confirmed: openFDA answers a page past the end and a search that matched nothing alike, and the follow-up request for the total failed. total then reads 0 without ruling out records at a lower skip â\x80\x94 re-call with skip=0 to tell.'}}, 'description': 'Response metadata', 'additionalProperties': False}, 'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['canvas_disabled', 'canvas_not_found', 'canvas_capacity_exhausted', 'rate_limited', 'upstream_error', 'malformed_search', 'query_error', 'pagination_limit_reached'], 'description': 'Machine-readable failure mode. Declared by this tool: `canvas_disabled`: Staging was requested (stage=true or a canvas_id) but DataCanvas is disabled. `canvas_not_found`: The canvas_id is well-formed but names no active canvas â\x80\x94 expired or never minted. `canvas_capacity_exhausted`: canvas_id was omitted and the active canvas cap is already reached. `rate_limited`: The openFDA daily or per-minute request limit is exceeded. `upstream_error`: The openFDA API returned a 5xx server error. `malformed_search`: The search query leaves a double quote, parenthesis, or range bracket unclosed, or ends on a backslash. `query_error`: The search query was rejected by openFDA (malformed field name, invalid syntax). `pagination_limit_reached`: skip exceeds the 25000 record pagination ceiling. Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'notice': {'type': 'string', 'description': 'Canvas staging disclosure when the call staged, the byte-budget disclosure and the routes to the withheld records when the inline page was bounded, and guidance when results are empty or paging overshot â\x80\x94 how to broaden filters or adjust the query.'}, 'results': {'type': 'array', 'items': {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {}}, 'description': 'Adverse event records â\x80\x94 fields vary by category (drug: patient/reactions/drugs, device: device details/event type, food: products/outcomes)'}, 'spilled': {'type': 'boolean', 'description': 'True when this call staged its matched set on the canvas â\x80\x94 use canvas_id with openfda_dataframe_describe for its columns, then openfda_dataframe_query for SQL. Absent when staging was not requested.'}, 'canvas_id': {'type': 'string', 'description': 'DataCanvas session id for the staged result set. Present when this call staged. Pass to openfda_dataframe_query / openfda_dataframe_describe, or back into this tool to accumulate more tables on the same canvas.'}, 'truncated': {'type': 'boolean', 'description': "True when fewer rows reached the canvas than matched upstream â\x80\x94 staging stopped at its size budget or openFDA's 25000-row pagination ceiling. Narrow the query (filters, date range) for a complete set."}, 'page_bytes': {'type': 'number', 'description': 'Serialized size of results in this response, in bytes. Present only when the 24000-byte inline budget bounded the page; larger than the budget only when a single record exceeds it on its own.'}, 'staged_rows': {'type': 'number', 'description': 'Rows written to the canvas table. Compare with meta.total: a smaller value means staging stopped at its size budget and the table holds only the first staged_rows records.'}, 'canvas_table': {'type': 'string', 'description': 'Canvas table holding the staged rows. Present when rows were staged; list its columns with openfda_dataframe_describe, then reference it in openfda_dataframe_query FROM clauses.'}, 'page_omitted': {'type': 'number', 'description': 'Records dropped from the requested limit/skip window so the page fit the inline byte budget. Present only when the page was bounded. Read them by re-calling with skip advanced by the number of records returned, lower limit for a smaller page, or pass stage=true to query a bounded drain of the match with openfda_dataframe_query.'}, 'totalResults': {'type': 'number', 'description': 'Total matching adverse event records in the dataset'}, 'effectiveQuery': {'type': 'string', 'description': 'Search filter applied to the query, as submitted to openFDA'}}, 'additionalProperties': False}
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'skip': {'type': 'number', 'default': 0, '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.'}, 'sort': {'type': 'string', 'pattern': '^ *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?(?: *, *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?)* *$', 'minLength': 1, 'description': 'Sort expression â\x80\x94 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 â\x80\x94 use a documented field name.'}, 'limit': {'type': 'number', 'default': 10, 'maximum': 1000, 'minimum': 1, '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.'}, 'stage': {'type': 'boolean', 'default': False, 'description': 'Stage the matched set on a DataCanvas for SQL analysis â\x80\x94 openfda_dataframe_describe lists the staged columns, openfda_dataframe_query runs the SQL. Default false â\x80\x94 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.'}, 'search': {'type': 'string', 'pattern': '\\S', 'minLength': 1, '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 â\x80\x94 each is rejected before the request.'}, 'canvas_id': {'type': 'string', 'pattern': '^[A-Za-z0-9_-]{10}$', '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.'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['meta', 'results', 'totalResults']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'meta': {'type': 'object', 'required': ['total', 'skip', 'limit', 'lastUpdated'], 'properties': {'skip': {'type': 'number', 'description': 'Pagination offset'}, 'limit': {'type': 'number', 'description': 'Page size applied to this request â\x80\x94 the requested limit, lowered to the records returned when the 24000-byte inline budget bounded the page (see page_omitted). Not a count of what arrived: a window running past the end of the matched set returns fewer records than this, so read the length of results for the actual count.'}, 'total': {'type': 'number', 'description': 'Total matching records in the dataset'}, 'lastUpdated': {'type': 'string', 'description': 'Dataset last updated date'}, 'totalUnverified': {'type': 'boolean', 'description': 'Present (true) only on an empty page at skip > 0 whose total could not be confirmed: openFDA answers a page past the end and a search that matched nothing alike, and the follow-up request for the total failed. total then reads 0 without ruling out records at a lower skip â\x80\x94 re-call with skip=0 to tell.'}}, 'description': 'Response metadata', 'additionalProperties': False}, 'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['canvas_disabled', 'canvas_not_found', 'canvas_capacity_exhausted', 'rate_limited', 'upstream_error', 'malformed_search', 'query_error', 'pagination_limit_reached'], 'description': 'Machine-readable failure mode. Declared by this tool: `canvas_disabled`: Staging was requested (stage=true or a canvas_id) but DataCanvas is disabled. `canvas_not_found`: The canvas_id is well-formed but names no active canvas â\x80\x94 expired or never minted. `canvas_capacity_exhausted`: canvas_id was omitted and the active canvas cap is already reached. `rate_limited`: The openFDA daily or per-minute request limit is exceeded. `upstream_error`: The openFDA API returned a 5xx server error. `malformed_search`: The search query leaves a double quote, parenthesis, or range bracket unclosed, or ends on a backslash. `query_error`: The search query was rejected by openFDA (malformed field name, invalid syntax). `pagination_limit_reached`: skip exceeds the 25000 record pagination ceiling. Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'notice': {'type': 'string', 'description': 'Canvas staging disclosure when the call staged, the byte-budget disclosure and the routes to the withheld records when the inline page was bounded, and guidance when results are empty or paging overshot â\x80\x94 how to broaden filters or adjust the query.'}, 'results': {'type': 'array', 'items': {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {}}, 'description': 'Animal adverse event records. Key fields: unique_aer_id_number, original_receive_date, serious_ae, animal (species, gender, breed, age, weight), drug[] (brand_name, active_ingredients, route, dose, administered_by), reaction[] (veddra_term_name, number_of_animals_affected), outcome[] (medical_status), primary_reporter, type_of_information.'}, 'spilled': {'type': 'boolean', 'description': 'True when this call staged its matched set on the canvas â\x80\x94 use canvas_id with openfda_dataframe_describe for its columns, then openfda_dataframe_query for SQL. Absent when staging was not requested.'}, 'canvas_id': {'type': 'string', 'description': 'DataCanvas session id for the staged result set. Present when this call staged. Pass to openfda_dataframe_query / openfda_dataframe_describe, or back into this tool to accumulate more tables on the same canvas.'}, 'truncated': {'type': 'boolean', 'description': "True when fewer rows reached the canvas than matched upstream â\x80\x94 staging stopped at its size budget or openFDA's 25000-row pagination ceiling. Narrow the query (filters, date range) for a complete set."}, 'page_bytes': {'type': 'number', 'description': 'Serialized size of results in this response, in bytes. Present only when the 24000-byte inline budget bounded the page; larger than the budget only when a single record exceeds it on its own.'}, 'staged_rows': {'type': 'number', 'description': 'Rows written to the canvas table. Compare with meta.total: a smaller value means staging stopped at its size budget and the table holds only the first staged_rows records.'}, 'canvas_table': {'type': 'string', 'description': 'Canvas table holding the staged rows. Present when rows were staged; list its columns with openfda_dataframe_describe, then reference it in openfda_dataframe_query FROM clauses.'}, 'page_omitted': {'type': 'number', 'description': 'Records dropped from the requested limit/skip window so the page fit the inline byte budget. Present only when the page was bounded. Read them by re-calling with skip advanced by the number of records returned, lower limit for a smaller page, or pass stage=true to query a bounded drain of the match with openfda_dataframe_query.'}, 'totalResults': {'type': 'number', 'description': 'Total matching animal adverse event records in the dataset'}, 'effectiveQuery': {'type': 'string', 'description': 'Search filter applied to the query, as submitted to openFDA'}}, 'additionalProperties': False}
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['pathway'], 'properties': {'skip': {'type': 'number', 'default': 0, '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.'}, 'sort': {'type': 'string', 'pattern': '^ *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?(?: *, *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?)* *$', 'minLength': 1, 'description': 'Sort expression â\x80\x94 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 â\x80\x94 use a documented field name.'}, 'limit': {'type': 'number', 'default': 10, 'maximum': 1000, 'minimum': 1, '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.'}, 'stage': {'type': 'boolean', 'default': False, 'description': 'Stage the matched set on a DataCanvas for SQL analysis â\x80\x94 openfda_dataframe_describe lists the staged columns, openfda_dataframe_query runs the SQL. Default false â\x80\x94 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.'}, 'search': {'type': 'string', 'pattern': '\\S', 'minLength': 1, '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 â\x80\x94 each is rejected before the request.'}, 'pathway': {'enum': ['510k', 'pma'], 'type': 'string', 'description': 'Premarket pathway. 510(k) is the most common; PMA is for higher-risk devices.'}, 'canvas_id': {'type': 'string', 'pattern': '^[A-Za-z0-9_-]{10}$', '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.'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['meta', 'results', 'totalResults']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'meta': {'type': 'object', 'required': ['total', 'skip', 'limit', 'lastUpdated'], 'properties': {'skip': {'type': 'number', 'description': 'Pagination offset'}, 'limit': {'type': 'number', 'description': 'Page size applied to this request â\x80\x94 the requested limit, lowered to the records returned when the 24000-byte inline budget bounded the page (see page_omitted). Not a count of what arrived: a window running past the end of the matched set returns fewer records than this, so read the length of results for the actual count.'}, 'total': {'type': 'number', 'description': 'Total matching records'}, 'lastUpdated': {'type': 'string', 'description': 'Dataset last updated date'}, 'totalUnverified': {'type': 'boolean', 'description': 'Present (true) only on an empty page at skip > 0 whose total could not be confirmed: openFDA answers a page past the end and a search that matched nothing alike, and the follow-up request for the total failed. total then reads 0 without ruling out records at a lower skip â\x80\x94 re-call with skip=0 to tell.'}}, 'description': 'Response metadata', 'additionalProperties': False}, 'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['canvas_disabled', 'canvas_not_found', 'canvas_capacity_exhausted', 'rate_limited', 'upstream_error', 'malformed_search', 'query_error', 'pagination_limit_reached'], 'description': 'Machine-readable failure mode. Declared by this tool: `canvas_disabled`: Staging was requested (stage=true or a canvas_id) but DataCanvas is disabled. `canvas_not_found`: The canvas_id is well-formed but names no active canvas â\x80\x94 expired or never minted. `canvas_capacity_exhausted`: canvas_id was omitted and the active canvas cap is already reached. `rate_limited`: The openFDA daily or per-minute request limit is exceeded. `upstream_error`: The openFDA API returned a 5xx server error. `malformed_search`: The search query leaves a double quote, parenthesis, or range bracket unclosed, or ends on a backslash. `query_error`: The search query was rejected by openFDA (malformed field name, invalid syntax). `pagination_limit_reached`: skip exceeds the 25000 record pagination ceiling. Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'notice': {'type': 'string', 'description': 'Canvas staging disclosure when the call staged, the byte-budget disclosure and the routes to the withheld records when the inline page was bounded, and guidance when results are empty â\x80\x94 how to broaden filters or correct field names.'}, 'results': {'type': 'array', 'items': {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {}}, 'description': '510(k) or PMA records â\x80\x94 510(k) carries k_number, device_name, applicant, product_code, decision_date, decision_description, advisory_committee_description; PMA carries pma_number, trade_name, generic_name, supplement_number plus shared applicant/product_code/decision_date/decision_description.'}, 'spilled': {'type': 'boolean', 'description': 'True when this call staged its matched set on the canvas â\x80\x94 use canvas_id with openfda_dataframe_describe for its columns, then openfda_dataframe_query for SQL. Absent when staging was not requested.'}, 'canvas_id': {'type': 'string', 'description': 'DataCanvas session id for the staged result set. Present when this call staged. Pass to openfda_dataframe_query / openfda_dataframe_describe, or back into this tool to accumulate more tables on the same canvas.'}, 'truncated': {'type': 'boolean', 'description': "True when fewer rows reached the canvas than matched upstream â\x80\x94 staging stopped at its size budget or openFDA's 25000-row pagination ceiling. Narrow the query (filters, date range) for a complete set."}, 'page_bytes': {'type': 'number', 'description': 'Serialized size of results in this response, in bytes. Present only when the 24000-byte inline budget bounded the page; larger than the budget only when a single record exceeds it on its own.'}, 'staged_rows': {'type': 'number', 'description': 'Rows written to the canvas table. Compare with meta.total: a smaller value means staging stopped at its size budget and the table holds only the first staged_rows records.'}, 'canvas_table': {'type': 'string', 'description': 'Canvas table holding the staged rows. Present when rows were staged; list its columns with openfda_dataframe_describe, then reference it in openfda_dataframe_query FROM clauses.'}, 'page_omitted': {'type': 'number', 'description': 'Records dropped from the requested limit/skip window so the page fit the inline byte budget. Present only when the page was bounded. Read them by re-calling with skip advanced by the number of records returned, lower limit for a smaller page, or pass stage=true to query a bounded drain of the match with openfda_dataframe_query.'}, 'totalResults': {'type': 'number', 'description': 'Total matching device clearance records in the dataset'}, 'effectiveQuery': {'type': 'string', 'description': 'Search filter applied to the device clearance query, as submitted to openFDA'}}, 'additionalProperties': False}
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'skip': {'type': 'number', 'default': 0, '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.'}, 'sort': {'type': 'string', 'pattern': '^ *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?(?: *, *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?)* *$', 'minLength': 1, 'description': 'Sort expression â\x80\x94 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 â\x80\x94 use a documented field name.'}, 'limit': {'type': 'number', 'default': 10, 'maximum': 1000, 'minimum': 1, '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."}, 'stage': {'type': 'boolean', 'default': False, 'description': 'Stage the matched set on a DataCanvas for SQL analysis â\x80\x94 openfda_dataframe_describe lists the staged columns, openfda_dataframe_query runs the SQL. Default false â\x80\x94 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.'}, 'search': {'type': 'string', 'pattern': '\\S', 'minLength': 1, '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 â\x80\x94 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 â\x80\x94 each is rejected before the request.'}, 'canvas_id': {'type': 'string', 'pattern': '^[A-Za-z0-9_-]{10}$', '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.'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['meta', 'results', 'totalResults']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'meta': {'type': 'object', 'required': ['total', 'skip', 'limit', 'lastUpdated'], 'properties': {'skip': {'type': 'number', 'description': 'Pagination offset'}, 'limit': {'type': 'number', 'description': 'Page size applied to this request â\x80\x94 the requested limit, lowered to the records returned when the 24000-byte inline budget bounded the page (see page_omitted). Not a count of what arrived: a window running past the end of the matched set returns fewer records than this, so read the length of results for the actual count.'}, 'total': {'type': 'number', 'description': 'Total matching records'}, 'lastUpdated': {'type': 'string', 'description': 'Dataset last updated date'}, 'totalUnverified': {'type': 'boolean', 'description': 'Present (true) only on an empty page at skip > 0 whose total could not be confirmed: openFDA answers a page past the end and a search that matched nothing alike, and the follow-up request for the total failed. total then reads 0 without ruling out records at a lower skip â\x80\x94 re-call with skip=0 to tell.'}}, 'description': 'Response metadata', 'additionalProperties': False}, 'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['canvas_disabled', 'canvas_not_found', 'canvas_capacity_exhausted', 'rate_limited', 'upstream_error', 'malformed_search', 'query_error', 'pagination_limit_reached'], 'description': 'Machine-readable failure mode. Declared by this tool: `canvas_disabled`: Staging was requested (stage=true or a canvas_id) but DataCanvas is disabled. `canvas_not_found`: The canvas_id is well-formed but names no active canvas â\x80\x94 expired or never minted. `canvas_capacity_exhausted`: canvas_id was omitted and the active canvas cap is already reached. `rate_limited`: The openFDA daily or per-minute request limit is exceeded. `upstream_error`: The openFDA API returned a 5xx server error. `malformed_search`: The search query leaves a double quote, parenthesis, or range bracket unclosed, or ends on a backslash. `query_error`: The search query was rejected by openFDA (malformed field name, invalid syntax). `pagination_limit_reached`: skip exceeds the 25000 record pagination ceiling. Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'notice': {'type': 'string', 'description': 'Canvas staging disclosure when the call staged, the byte-budget disclosure and the routes to the withheld records when the inline page was bounded, and guidance when results are empty â\x80\x94 how to broaden filters or correct field names.'}, 'results': {'type': 'array', 'items': {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {}}, 'description': 'Drug application records â\x80\x94 application_number, sponsor_name, openfda block (brand_name, generic_name, route, product_type, substance_name), products[] (active_ingredients, dosage_form, marketing_status), submissions[] (submission_type, submission_status, submission_status_date, review_priority).'}, 'spilled': {'type': 'boolean', 'description': 'True when this call staged its matched set on the canvas â\x80\x94 use canvas_id with openfda_dataframe_describe for its columns, then openfda_dataframe_query for SQL. Absent when staging was not requested.'}, 'canvas_id': {'type': 'string', 'description': 'DataCanvas session id for the staged result set. Present when this call staged. Pass to openfda_dataframe_query / openfda_dataframe_describe, or back into this tool to accumulate more tables on the same canvas.'}, 'truncated': {'type': 'boolean', 'description': "True when fewer rows reached the canvas than matched upstream â\x80\x94 staging stopped at its size budget or openFDA's 25000-row pagination ceiling. Narrow the query (filters, date range) for a complete set."}, 'page_bytes': {'type': 'number', 'description': 'Serialized size of results in this response, in bytes. Present only when the 24000-byte inline budget bounded the page; larger than the budget only when a single record exceeds it on its own.'}, 'staged_rows': {'type': 'number', 'description': 'Rows written to the canvas table. Compare with meta.total: a smaller value means staging stopped at its size budget and the table holds only the first staged_rows records.'}, 'canvas_table': {'type': 'string', 'description': 'Canvas table holding the staged rows. Present when rows were staged; list its columns with openfda_dataframe_describe, then reference it in openfda_dataframe_query FROM clauses.'}, 'page_omitted': {'type': 'number', 'description': 'Records dropped from the requested limit/skip window so the page fit the inline byte budget. Present only when the page was bounded. Read them by re-calling with skip advanced by the number of records returned, lower limit for a smaller page, or pass stage=true to query a bounded drain of the match with openfda_dataframe_query.'}, 'totalResults': {'type': 'number', 'description': 'Total matching drug approval records in the dataset'}, 'effectiveQuery': {'type': 'string', 'description': 'Search filter applied to the Drugs@FDA query, as submitted to openFDA'}}, 'additionalProperties': False}
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'skip': {'type': 'number', 'default': 0, '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.'}, 'sort': {'type': 'string', 'pattern': '^ *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?(?: *, *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?)* *$', 'minLength': 1, 'description': 'Sort expression â\x80\x94 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 â\x80\x94 use a documented field name.'}, 'limit': {'type': 'number', 'default': 10, 'maximum': 1000, 'minimum': 1, '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.'}, 'stage': {'type': 'boolean', 'default': False, 'description': 'Stage the matched set on a DataCanvas for SQL analysis â\x80\x94 openfda_dataframe_describe lists the staged columns, openfda_dataframe_query runs the SQL. Default false â\x80\x94 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.'}, 'search': {'type': 'string', 'pattern': '\\S', 'minLength': 1, '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 â\x80\x94 each is rejected before the request. Call openfda_describe_fields({ endpoint: "drug/shortages" }) for the complete field list.'}, 'canvas_id': {'type': 'string', 'pattern': '^[A-Za-z0-9_-]{10}$', '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.'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['meta', 'results', 'totalResults']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'meta': {'type': 'object', 'required': ['total', 'skip', 'limit', 'lastUpdated'], 'properties': {'skip': {'type': 'number', 'description': 'Pagination offset'}, 'limit': {'type': 'number', 'description': 'Page size applied to this request â\x80\x94 the requested limit, lowered to the records returned when the 24000-byte inline budget bounded the page (see page_omitted). Not a count of what arrived: a window running past the end of the matched set returns fewer records than this, so read the length of results for the actual count.'}, 'total': {'type': 'number', 'description': 'Total matching shortage records in the database'}, 'lastUpdated': {'type': 'string', 'description': 'Dataset last updated date'}, 'totalUnverified': {'type': 'boolean', 'description': 'Present (true) only on an empty page at skip > 0 whose total could not be confirmed: openFDA answers a page past the end and a search that matched nothing alike, and the follow-up request for the total failed. total then reads 0 without ruling out records at a lower skip â\x80\x94 re-call with skip=0 to tell.'}}, 'description': 'Response metadata', 'additionalProperties': False}, 'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['canvas_disabled', 'canvas_not_found', 'canvas_capacity_exhausted', 'rate_limited', 'upstream_error', 'malformed_search', 'query_error', 'pagination_limit_reached'], 'description': 'Machine-readable failure mode. Declared by this tool: `canvas_disabled`: Staging was requested (stage=true or a canvas_id) but DataCanvas is disabled. `canvas_not_found`: The canvas_id is well-formed but names no active canvas â\x80\x94 expired or never minted. `canvas_capacity_exhausted`: canvas_id was omitted and the active canvas cap is already reached. `rate_limited`: The openFDA daily or per-minute request limit is exceeded. `upstream_error`: The openFDA API returned a 5xx server error. `malformed_search`: The search query leaves a double quote, parenthesis, or range bracket unclosed, or ends on a backslash. `query_error`: The search query was rejected by openFDA (malformed field name, invalid syntax). `pagination_limit_reached`: skip exceeds the 25000 record pagination ceiling. Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'notice': {'type': 'string', 'description': 'Canvas staging disclosure when the call staged, the byte-budget disclosure and the routes to the withheld records when the inline page was bounded, and guidance when results are empty â\x80\x94 how to broaden filters or correct field names.'}, 'results': {'type': 'array', 'items': {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {}}, 'description': 'Drug shortage records. Key fields: generic_name, status ("Current"/"Resolved"), availability, therapeutic_category, dosage_form, presentation, package_ndc, company_name, contact_info, initial_posting_date, update_date, update_type. openfda block contains brand_name, product_ndc, rxcui, spl_set_id for cross-linking.'}, 'spilled': {'type': 'boolean', 'description': 'True when this call staged its matched set on the canvas â\x80\x94 use canvas_id with openfda_dataframe_describe for its columns, then openfda_dataframe_query for SQL. Absent when staging was not requested.'}, 'canvas_id': {'type': 'string', 'description': 'DataCanvas session id for the staged result set. Present when this call staged. Pass to openfda_dataframe_query / openfda_dataframe_describe, or back into this tool to accumulate more tables on the same canvas.'}, 'truncated': {'type': 'boolean', 'description': "True when fewer rows reached the canvas than matched upstream â\x80\x94 staging stopped at its size budget or openFDA's 25000-row pagination ceiling. Narrow the query (filters, date range) for a complete set."}, 'page_bytes': {'type': 'number', 'description': 'Serialized size of results in this response, in bytes. Present only when the 24000-byte inline budget bounded the page; larger than the budget only when a single record exceeds it on its own.'}, 'staged_rows': {'type': 'number', 'description': 'Rows written to the canvas table. Compare with meta.total: a smaller value means staging stopped at its size budget and the table holds only the first staged_rows records.'}, 'canvas_table': {'type': 'string', 'description': 'Canvas table holding the staged rows. Present when rows were staged; list its columns with openfda_dataframe_describe, then reference it in openfda_dataframe_query FROM clauses.'}, 'page_omitted': {'type': 'number', 'description': 'Records dropped from the requested limit/skip window so the page fit the inline byte budget. Present only when the page was bounded. Read them by re-calling with skip advanced by the number of records returned, lower limit for a smaller page, or pass stage=true to query a bounded drain of the match with openfda_dataframe_query.'}, 'totalResults': {'type': 'number', 'description': 'Total matching drug shortage records in the dataset'}, 'effectiveQuery': {'type': 'string', 'description': 'Search filter applied to the drug/shortages query, as submitted to openFDA'}}, 'additionalProperties': False}
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['category'], 'properties': {'skip': {'type': 'number', 'default': 0, '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.'}, 'sort': {'type': 'string', 'pattern': '^ *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?(?: *, *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?)* *$', 'minLength': 1, 'description': 'Sort expression â\x80\x94 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 â\x80\x94 use a documented field name.'}, 'limit': {'type': 'number', 'default': 10, 'maximum': 1000, 'minimum': 1, '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 â\x80\x94 a device enforcement or recall record runs several kilobytes where a drug or food enforcement record is around one.'}, 'stage': {'type': 'boolean', 'default': False, 'description': 'Stage the matched set on a DataCanvas for SQL analysis â\x80\x94 openfda_dataframe_describe lists the staged columns, openfda_dataframe_query runs the SQL. Default false â\x80\x94 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.'}, 'search': {'type': 'string', 'pattern': '\\S', 'minLength': 1, '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 â\x80\x94 each is rejected before the request.'}, 'category': {'enum': ['drug', 'food', 'device'], 'type': 'string', 'description': 'Product category'}, 'endpoint': {'enum': ['enforcement', 'recall'], 'type': 'string', 'default': 'enforcement', 'description': 'Report type. Default enforcement. The recall endpoint is only available for devices.'}, 'canvas_id': {'type': 'string', 'pattern': '^[A-Za-z0-9_-]{10}$', '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.'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['meta', 'results', 'totalResults']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'meta': {'type': 'object', 'required': ['total', 'skip', 'limit', 'lastUpdated'], 'properties': {'skip': {'type': 'number', 'description': 'Pagination offset'}, 'limit': {'type': 'number', 'description': 'Page size applied to this request â\x80\x94 the requested limit, lowered to the records returned when the 24000-byte inline budget bounded the page (see page_omitted). Not a count of what arrived: a window running past the end of the matched set returns fewer records than this, so read the length of results for the actual count.'}, 'total': {'type': 'number', 'description': 'Total matching records'}, 'lastUpdated': {'type': 'string', 'description': 'Dataset last updated date'}, 'totalUnverified': {'type': 'boolean', 'description': 'Present (true) only on an empty page at skip > 0 whose total could not be confirmed: openFDA answers a page past the end and a search that matched nothing alike, and the follow-up request for the total failed. total then reads 0 without ruling out records at a lower skip â\x80\x94 re-call with skip=0 to tell.'}}, 'description': 'Response metadata', 'additionalProperties': False}, 'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['recall_endpoint_non_device', 'canvas_disabled', 'canvas_not_found', 'canvas_capacity_exhausted', 'rate_limited', 'upstream_error', 'malformed_search', 'query_error', 'pagination_limit_reached'], 'description': 'Machine-readable failure mode. Declared by this tool: `recall_endpoint_non_device`: The recall endpoint was requested for a non-device category. `canvas_disabled`: Staging was requested (stage=true or a canvas_id) but DataCanvas is disabled. `canvas_not_found`: The canvas_id is well-formed but names no active canvas â\x80\x94 expired or never minted. `canvas_capacity_exhausted`: canvas_id was omitted and the active canvas cap is already reached. `rate_limited`: The openFDA daily or per-minute request limit is exceeded. `upstream_error`: The openFDA API returned a 5xx server error. `malformed_search`: The search query leaves a double quote, parenthesis, or range bracket unclosed, or ends on a backslash. `query_error`: The search query was rejected by openFDA (malformed field name, invalid syntax). `pagination_limit_reached`: skip exceeds the 25000 record pagination ceiling. Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'notice': {'type': 'string', 'description': 'Canvas staging disclosure when the call staged, the byte-budget disclosure and the routes to the withheld records when the inline page was bounded, and guidance when results are empty â\x80\x94 how to broaden filters or correct field names.'}, 'results': {'type': 'array', 'items': {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {}}, 'description': 'Enforcement or recall records. Enforcement records (every category) carry recall_number, classification, status, voluntary_mandated, recalling_firm, product_description, reason_for_recall, distribution_pattern, report_date. Device recall records name identity product_res_number and status recall_status, add res_event_number and root_cause_description, share the firm, product, reason, and distribution fields, and carry no recall hazard classification.'}, 'spilled': {'type': 'boolean', 'description': 'True when this call staged its matched set on the canvas â\x80\x94 use canvas_id with openfda_dataframe_describe for its columns, then openfda_dataframe_query for SQL. Absent when staging was not requested.'}, 'canvas_id': {'type': 'string', 'description': 'DataCanvas session id for the staged result set. Present when this call staged. Pass to openfda_dataframe_query / openfda_dataframe_describe, or back into this tool to accumulate more tables on the same canvas.'}, 'truncated': {'type': 'boolean', 'description': "True when fewer rows reached the canvas than matched upstream â\x80\x94 staging stopped at its size budget or openFDA's 25000-row pagination ceiling. Narrow the query (filters, date range) for a complete set."}, 'page_bytes': {'type': 'number', 'description': 'Serialized size of results in this response, in bytes. Present only when the 24000-byte inline budget bounded the page; larger than the budget only when a single record exceeds it on its own.'}, 'staged_rows': {'type': 'number', 'description': 'Rows written to the canvas table. Compare with meta.total: a smaller value means staging stopped at its size budget and the table holds only the first staged_rows records.'}, 'canvas_table': {'type': 'string', 'description': 'Canvas table holding the staged rows. Present when rows were staged; list its columns with openfda_dataframe_describe, then reference it in openfda_dataframe_query FROM clauses.'}, 'page_omitted': {'type': 'number', 'description': 'Records dropped from the requested limit/skip window so the page fit the inline byte budget. Present only when the page was bounded. Read them by re-calling with skip advanced by the number of records returned, lower limit for a smaller page, or pass stage=true to query a bounded drain of the match with openfda_dataframe_query.'}, 'totalResults': {'type': 'number', 'description': 'Total matching recall/enforcement records in the dataset'}, 'effectiveQuery': {'type': 'string', 'description': 'Search filter applied to the recall query, as submitted to openFDA'}}, 'additionalProperties': False}
Schéma d’entrée
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'skip': {'type': 'number', 'default': 0, '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.'}, 'sort': {'type': 'string', 'pattern': '^ *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?(?: *, *[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*(?::[^,:]*)?)* *$', 'minLength': 1, 'description': 'Sort expression â\x80\x94 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 â\x80\x94 use a documented field name.'}, 'limit': {'type': 'number', 'default': 10, 'maximum': 1000, 'minimum': 1, '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.'}, 'stage': {'type': 'boolean', 'default': False, 'description': 'Stage the matched set on a DataCanvas for SQL analysis â\x80\x94 openfda_dataframe_describe lists the staged columns, openfda_dataframe_query runs the SQL. Default false â\x80\x94 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.'}, 'search': {'type': 'string', 'pattern': '\\S', 'minLength': 1, '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 â\x80\x94 each is rejected before the request.'}, 'canvas_id': {'type': 'string', 'pattern': '^[A-Za-z0-9_-]{10}$', '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.'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', 'anyOf': [{'not': {'required': ['error']}, 'required': ['meta', 'results', 'totalResults']}, {'required': ['error']}], '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'meta': {'type': 'object', 'required': ['total', 'skip', 'limit', 'lastUpdated'], 'properties': {'skip': {'type': 'number', 'description': 'Pagination offset'}, 'limit': {'type': 'number', 'description': 'Page size applied to this request â\x80\x94 the requested limit, lowered to the records returned when the 24000-byte inline budget bounded the page (see page_omitted). Not a count of what arrived: a window running past the end of the matched set returns fewer records than this, so read the length of results for the actual count.'}, 'total': {'type': 'number', 'description': 'Total matching records in the dataset'}, 'lastUpdated': {'type': 'string', 'description': 'Dataset last updated date'}, 'totalUnverified': {'type': 'boolean', 'description': 'Present (true) only on an empty page at skip > 0 whose total could not be confirmed: openFDA answers a page past the end and a search that matched nothing alike, and the follow-up request for the total failed. total then reads 0 without ruling out records at a lower skip â\x80\x94 re-call with skip=0 to tell.'}}, 'description': 'Response metadata', 'additionalProperties': False}, 'error': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'JSON-RPC error code for this failure.'}, 'data': {'type': 'object', 'properties': {'reason': {'type': 'string', 'examples': ['canvas_disabled', 'canvas_not_found', 'canvas_capacity_exhausted', 'rate_limited', 'upstream_error', 'malformed_search', 'query_error', 'pagination_limit_reached'], 'description': 'Machine-readable failure mode. Declared by this tool: `canvas_disabled`: Staging was requested (stage=true or a canvas_id) but DataCanvas is disabled. `canvas_not_found`: The canvas_id is well-formed but names no active canvas â\x80\x94 expired or never minted. `canvas_capacity_exhausted`: canvas_id was omitted and the active canvas cap is already reached. `rate_limited`: The openFDA daily or per-minute request limit is exceeded. `upstream_error`: The openFDA API returned a 5xx server error. `malformed_search`: The search query leaves a double quote, parenthesis, or range bracket unclosed, or ends on a backslash. `query_error`: The search query was rejected by openFDA (malformed field name, invalid syntax). `pagination_limit_reached`: skip exceeds the 25000 record pagination ceiling. Other values are possible when a failure originates below the handler.'}, 'recovery': {'type': 'object', 'required': ['hint'], 'properties': {'hint': {'type': 'string'}}, 'description': 'Actionable next step for the caller.', 'additionalProperties': {}}, 'retryable': {'type': 'boolean', 'description': 'Whether retrying may succeed.'}}, 'additionalProperties': {}}, 'message': {'type': 'string', 'description': 'Human-readable description of what went wrong.'}}, 'description': 'Present when the call failed. Absent on success.', 'additionalProperties': {}}, 'notice': {'type': 'string', 'description': 'Canvas staging disclosure when the call staged, the byte-budget disclosure and the routes to the withheld records when the inline page was bounded, and guidance when results are empty or paging overshot â\x80\x94 how to broaden filters or adjust the query.'}, 'results': {'type': 'array', 'items': {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {}}, 'description': 'Tobacco problem report records. Key fields: report_id, date_submitted, tobacco_products[] (product type description), reported_health_problems[] (health effects), reported_product_problems[] (device/product defects), number_tobacco_products, number_health_problems, number_product_problems, nonuser_affected.'}, 'spilled': {'type': 'boolean', 'description': 'True when this call staged its matched set on the canvas â\x80\x94 use canvas_id with openfda_dataframe_describe for its columns, then openfda_dataframe_query for SQL. Absent when staging was not requested.'}, 'canvas_id': {'type': 'string', 'description': 'DataCanvas session id for the staged result set. Present when this call staged. Pass to openfda_dataframe_query / openfda_dataframe_describe, or back into this tool to accumulate more tables on the same canvas.'}, 'truncated': {'type': 'boolean', 'description': "True when fewer rows reached the canvas than matched upstream â\x80\x94 staging stopped at its size budget or openFDA's 25000-row pagination ceiling. Narrow the query (filters, date range) for a complete set."}, 'page_bytes': {'type': 'number', 'description': 'Serialized size of results in this response, in bytes. Present only when the 24000-byte inline budget bounded the page; larger than the budget only when a single record exceeds it on its own.'}, 'staged_rows': {'type': 'number', 'description': 'Rows written to the canvas table. Compare with meta.total: a smaller value means staging stopped at its size budget and the table holds only the first staged_rows records.'}, 'canvas_table': {'type': 'string', 'description': 'Canvas table holding the staged rows. Present when rows were staged; list its columns with openfda_dataframe_describe, then reference it in openfda_dataframe_query FROM clauses.'}, 'page_omitted': {'type': 'number', 'description': 'Records dropped from the requested limit/skip window so the page fit the inline byte budget. Present only when the page was bounded. Read them by re-calling with skip advanced by the number of records returned, lower limit for a smaller page, or pass stage=true to query a bounded drain of the match with openfda_dataframe_query.'}, 'totalResults': {'type': 'number', 'description': 'Total matching tobacco problem reports in the dataset'}, 'effectiveQuery': {'type': 'string', 'description': 'Search filter applied to the query, as submitted to openFDA'}}, 'additionalProperties': False}
Modifications récentes des outils
Serveurs MCP similaires
Clink Forge
Provides pay-per-call access to attested government datasets, primarily CDC and HHS health data plus EPA air-quality observations.
Medicare Coverage
Provides structured Medicare coverage documents, policy timelines, utilization, enrollment, supplier, and payment-related data fr…
Openfda
Provides access to FDA drug, labeling, approval, adverse-event, recall, shortage, warning-letter, and enforcement data for biomed…
Fda Drug Competition
Analyzes FDA Orange Book drug applications, patents, exclusivities, generic competition, and loss-of-exclusivity timelines.
Cms Open Payments
Searches and analyzes CMS Open Payments data on payments from pharmaceutical and device companies to physicians, hospitals, and o…
Fda Devices
Searches FDA medical-device regulatory datasets covering 510(k)s, PMAs, classifications, registrations, recalls, UDI records, and…
Clinicaltables
Searches NIH clinical vocabularies and registries for conditions, diseases, drugs, procedures, ICD codes, LOINC codes, and health…
Pharma Intel
Combines clinical trial, FDA, PubMed, drug identification, safety, pipeline, sales, patent, and pharmaceutical sponsor data for d…