chembl-dataframe-query
chembl_dataframe_queryRun a read-only SQL SELECT over the bioactivity rows chembl_get_bioactivities staged on a canvas — rank, group, dedupe, and aggregate across the FULL set, not the inline preview. Reference each staged table by the name chembl_get_bioactivities returned — bioactivities for its potency_ranked view, bioactivities_null_potency for null_potency; discover the staged tables and their columns with chembl_dataframe_describe. Compute honest aggregates here (e.g. SELECT parent_molecule_chembl_id, MEDIAN(pchembl_value) AS med FROM bioactivities WHERE standard_type = 'IC50' AND potential_duplicate IS NOT TRUE GROUP BY 1 ORDER BY 2 DESC, which merges a drug with its salts and drops likely repeat citations). Every row the SQL returns comes back on both structuredContent and content[], so bound the result in the SQL itself: project only the columns you need and set a LIMIT. truncated is true when the result exceeded the canvas row cap; page past it with ORDER BY a unique column (e.g. activity_id) and LIMIT/OFFSET written into the query, in place of any LIMIT it already has — offsets reach rows beyond the cap. Unavailable when the server sets CANVAS_PROVIDER_TYPE=none.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"canvas_id": "<canvas_id>",
"sql": "<sql>"
},
"name": "chembl_dataframe_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | A read-only SELECT against the staged tables. Reference tables by the names chembl_get_bioactivities returned. | |
| canvas_id | Yes | Canvas ID returned by chembl_get_bioactivities — non-null whenever that call staged a table. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | No | Result rows (capped at the canvas row limit). Each row is a column→value map. | |
| error | No | Present when the call failed. Absent on success. | |
| row_count | No | Number of rows materialized in this response. | |
| truncated | No | True when the SQL result exceeded the canvas row cap, so rows is a bounded slice of the result set. Page past it with ORDER BY a unique column (e.g. activity_id) and LIMIT/OFFSET written into the query. |