{"openapi":"3.1.0","info":{"title":"openFDA (BYOK) API","version":"0.1.0","description":"openFDA (BYOK) lets an AI assistant read your own openFDA data through the openFDA API with a key you supply (openFDA API key). Read-only: 8 tools (search_drug_adverse_events, count_drug_adverse_events, search_drug_labels, search_drug_recalls, search_food_recalls, count_food_recalls, search_device_recalls, count_device_recalls). The BYOK key travels with each request, is used for that one call...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-openfda.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-openfda/docs"},"termsOfService":"https://connectorbay.com/byok-openfda/terms"},"servers":[{"url":"https://byok-openfda.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-openfda/docs"},"security":[{"upstreamKey":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Optional. A Pro API key raises rate limits; no credentials are required."},"upstreamKey":{"type":"apiKey","in":"header","name":"X-Upstream-Key","description":"Your own key for the service this connector wraps (bring your own key). Used for that one call only; never stored, logged or cached."}},"schemas":{"Error":{"type":"object","properties":{"ok":{"const":false},"error":{"type":"object"}}}}},"paths":{"/v1/tools/search_drug_adverse_events":{"post":{"operationId":"search_drug_adverse_events","summary":"Search FDA adverse event reports about drugs: report id, receipt date, seriousness, countries, patient sex and age, reac","description":"Search FDA adverse event reports about drugs: report id, receipt date, seriousness, countries, patient sex and age, reactions and the drugs listed. Reports are unverified and do not show that a drug caused the event. Use for \"What adverse events were reported for ibuprofen in 2025\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"search":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"default":null,"description":"Search expression field:term, for example patient.reaction.reactionmeddrapt:\"fatigue\". Combine with AND / OR (written with spaces), put quotes around phrases, and use ranges like receivedate:[20240101 TO 20241231].","title":"Search"},"sort":{"anyOf":[{"maxLength":80,"type":"string"},{"type":"null"}],"default":null,"description":"Sort expression field:asc or field:desc, for example receivedate:desc.","title":"Sort"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":5,"description":"Records to return, 1 to 100.","title":"Limit"},"skip":{"anyOf":[{"maximum":25000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Number of matching records to skip, 0 to 25000; use with limit to page.","title":"Skip"}},"title":"search_drug_adverse_eventsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/count_drug_adverse_events":{"post":{"operationId":"count_drug_adverse_events","summary":"Count how often each value of an adverse-event field occurs among matching reports, for example the most frequent reacti","description":"Count how often each value of an adverse-event field occurs among matching reports, for example the most frequent reactions for a drug. Returns term and count pairs. Use for \"What are the most reported reactions for ibuprofen\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"count":{"description":"Field to count, for example patient.reaction.reactionmeddrapt.exact (the .exact suffix counts whole phrases).","maxLength":120,"title":"Count","type":"string"},"search":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"default":null,"description":"Optional search expression restricting which records are counted, for example patient.drug.openfda.generic_name:\"ibuprofen\".","title":"Search"},"limit":{"anyOf":[{"maximum":1000,"minimum":1,"type":"integer"},{"type":"null"}],"default":25,"description":"How many distinct values to return, 1 to 1000 (most frequent first).","title":"Limit"}},"required":["count"],"title":"count_drug_adverse_eventsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/search_drug_labels":{"post":{"operationId":"search_drug_labels","summary":"Search FDA drug labels (package inserts): brand and generic names, manufacturer, route, purpose, indications, boxed warn","description":"Search FDA drug labels (package inserts): brand and generic names, manufacturer, route, purpose, indications, boxed warning, contraindications, warnings, adverse reactions, dosage and interactions. Label sections can be long, so use a small limit. Use for \"What is the boxed warning on the label of warfarin\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"search":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"default":null,"description":"Search expression field:term, for example patient.reaction.reactionmeddrapt:\"fatigue\". Combine with AND / OR (written with spaces), put quotes around phrases, and use ranges like receivedate:[20240101 TO 20241231].","title":"Search"},"sort":{"anyOf":[{"maxLength":80,"type":"string"},{"type":"null"}],"default":null,"description":"Sort expression field:asc or field:desc, for example effective_time:desc.","title":"Sort"},"limit":{"anyOf":[{"maximum":10,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Records to return, 1 to 10.","title":"Limit"},"skip":{"anyOf":[{"maximum":25000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Number of matching records to skip, 0 to 25000; use with limit to page.","title":"Skip"}},"title":"search_drug_labelsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/search_drug_recalls":{"post":{"operationId":"search_drug_recalls","summary":"Search FDA drug recall enforcement reports: recall number, status, classification (Class I to III), dates, recalling fir","description":"Search FDA drug recall enforcement reports: recall number, status, classification (Class I to III), dates, recalling firm, product, reason, quantity and distribution. Use for \"Which drug recalls were classified Class I this year\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"search":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"default":null,"description":"Search expression field:term, for example patient.reaction.reactionmeddrapt:\"fatigue\". Combine with AND / OR (written with spaces), put quotes around phrases, and use ranges like receivedate:[20240101 TO 20241231].","title":"Search"},"sort":{"anyOf":[{"maxLength":80,"type":"string"},{"type":"null"}],"default":null,"description":"Sort expression field:asc or field:desc, for example report_date:desc.","title":"Sort"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":10,"description":"Records to return, 1 to 100.","title":"Limit"},"skip":{"anyOf":[{"maximum":25000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Number of matching records to skip, 0 to 25000; use with limit to page.","title":"Skip"}},"title":"search_drug_recallsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/search_food_recalls":{"post":{"operationId":"search_food_recalls","summary":"Search FDA food recall enforcement reports: recall number, status, classification (Class I to III), dates, recalling fir","description":"Search FDA food recall enforcement reports: recall number, status, classification (Class I to III), dates, recalling firm, product, reason, quantity and distribution. Use for \"Which food recalls mention undeclared peanuts\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"search":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"default":null,"description":"Search expression field:term, for example patient.reaction.reactionmeddrapt:\"fatigue\". Combine with AND / OR (written with spaces), put quotes around phrases, and use ranges like receivedate:[20240101 TO 20241231].","title":"Search"},"sort":{"anyOf":[{"maxLength":80,"type":"string"},{"type":"null"}],"default":null,"description":"Sort expression field:asc or field:desc, for example report_date:desc.","title":"Sort"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":10,"description":"Records to return, 1 to 100.","title":"Limit"},"skip":{"anyOf":[{"maximum":25000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Number of matching records to skip, 0 to 25000; use with limit to page.","title":"Skip"}},"title":"search_food_recallsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/count_food_recalls":{"post":{"operationId":"count_food_recalls","summary":"Count food recalls by the values of a field, for example by classification or by voluntary versus mandated. Returns term","description":"Count food recalls by the values of a field, for example by classification or by voluntary versus mandated. Returns term and count pairs. Use for \"How many food recalls are Class I, II and III\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"count":{"description":"Field to count, for example classification.exact or voluntary_mandated.exact.","maxLength":120,"title":"Count","type":"string"},"search":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"default":null,"description":"Optional search expression restricting which records are counted, for example report_date:[20250101 TO 20251231].","title":"Search"},"limit":{"anyOf":[{"maximum":1000,"minimum":1,"type":"integer"},{"type":"null"}],"default":25,"description":"How many distinct values to return, 1 to 1000 (most frequent first).","title":"Limit"}},"required":["count"],"title":"count_food_recallsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/search_device_recalls":{"post":{"operationId":"search_device_recalls","summary":"Search FDA medical device recalls: event and product numbers, status, dates, recalling firm, product, reason, root cause","description":"Search FDA medical device recalls: event and product numbers, status, dates, recalling firm, product, reason, root cause, action, product code and device class. Use for \"Which pacemaker recalls were posted recently\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"search":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"default":null,"description":"Search expression field:term, for example patient.reaction.reactionmeddrapt:\"fatigue\". Combine with AND / OR (written with spaces), put quotes around phrases, and use ranges like receivedate:[20240101 TO 20241231].","title":"Search"},"sort":{"anyOf":[{"maxLength":80,"type":"string"},{"type":"null"}],"default":null,"description":"Sort expression field:asc or field:desc, for example event_date_posted:desc.","title":"Sort"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":10,"description":"Records to return, 1 to 100.","title":"Limit"},"skip":{"anyOf":[{"maximum":25000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Number of matching records to skip, 0 to 25000; use with limit to page.","title":"Skip"}},"title":"search_device_recallsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/count_device_recalls":{"post":{"operationId":"count_device_recalls","summary":"Count device recalls by the values of a field, for example by root cause or recall status. Returns term and count pairs.","description":"Count device recalls by the values of a field, for example by root cause or recall status. Returns term and count pairs. Use for \"What are the most common root causes of device recalls\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"count":{"description":"Field to count, for example root_cause_description.exact or recall_status.exact.","maxLength":120,"title":"Count","type":"string"},"search":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"default":null,"description":"Optional search expression restricting which records are counted, for example event_date_posted:[20250101 TO 20251231].","title":"Search"},"limit":{"anyOf":[{"maximum":1000,"minimum":1,"type":"integer"},{"type":"null"}],"default":25,"description":"How many distinct values to return, 1 to 1000 (most frequent first).","title":"Limit"}},"required":["count"],"title":"count_device_recallsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}}}}