paleobiology-mcp-server: query staged occurrences with SQL
paleobiology_dataframe_queryRun a read-only SQL SELECT against occurrence result sets staged on a DataCanvas by paleobiology_search_occurrences. This is how you analyze a large fossil set without re-fetching it: count occurrences by early_interval, group by formation, country (cc), or accepted_name, or filter by a paleo/modern coordinate range. The classification column is JSON — roll up by rank with json_extract_string(classification, '$.family') (also $.phylum, $.class, $.order, $.genus). Staged rows are occurrences, so collection-only fields such as lithology are not present. Reference tables by the table_name that paleobiology_search_occurrences returned — call paleobiology_dataframe_describe first if you do not know the table or column names. A result too large to return inline comes back as its first rows, with a notice naming the ORDER BY … LIMIT/OFFSET that reads the rest. SELECT only; writes and file-reading functions are rejected.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | A read-only SQL SELECT. Reference tables by the names paleobiology_search_occurrences / paleobiology_dataframe_describe returned. | |
| canvas_id | Yes | Canvas id returned by paleobiology_search_occurrences when its result spilled. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | No | Result rows in query order, ending at a whole row where more would exceed the inline response size. Keys are the selected column names. When rows were left out, the notice says how many are shown and the LIMIT/OFFSET that reads the rest. | |
| error | No | Present when the call failed. Absent on success. | |
| notice | No | Guidance when the result was cut to fit the inline response size (rows shown, the LIMIT/OFFSET that continues, and when to stop), when a single row was too large to show, or when row_count stopped at the canvas row cap. | |
| row_count | No | Rows the query produced, counted up to the canvas row cap — exact unless truncated is true, when it equals the cap and the result is larger. | |
| truncated | No | True when the query produced more rows than the canvas row cap, so row_count stopped counting at the cap. |