openfda_dataframe_query
ActiveTool of @cyanheads/openfda-mcp-server
Run a read-only SQL SELECT against a DataCanvas table staged by an openFDA search tool (canvas_id + canvas_table in its response when spilled=true). Enables GROUP BY, COUNT/SUM/AVG, time-series, and joins across the full result set without re-paging the API. Call openfda_dataframe_describe first to get the exact table and column names. Scalar fields are stored as text (CAST for numeric math); nested objects/arrays are JSON columns — read them with DuckDB json functions, e.g. json_extract_string(openfda, '$.brand_name[0]'). Only SELECT is allowed — DDL, DML, COPY, and file-reading functions are blocked.
Parameters schema
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"canvas_id",
"query"
],
"properties": {
"query": {
"type": "string",
"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",
"description": "Canvas ID from an openFDA search tool response (the canvas_id field)."
}
}
}Parent server
@cyanheads/openfda-mcp-server
https://github.com/cyanheads/openfda-mcp-server
2/7 registries