Skip to main content
Glama

chembl-dataframe-query

chembl_dataframe_query
Read-onlyIdempotent

Run 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 molecule_chembl_id, MEDIAN(pchembl_value) AS med FROM bioactivities WHERE standard_type = 'IC50' GROUP BY 1 ORDER BY 2 DESC). Two independent bounds apply, each reported on its own field: truncated is true when the SQL result exceeded the canvas row cap, and rendered_rows says how many of the returned rows the markdown table holds once its character budget is reached (below row_count on a wide or long result). Page past either bound with SQL LIMIT/OFFSET — append e.g. LIMIT 500 OFFSET 500 and re-call; offsets reach rows beyond the canvas row cap. Unavailable when the server sets CANVAS_PROVIDER_TYPE=none.

Input Schema

NameRequiredDescriptionDefault
sqlYesA read-only SELECT against the staged tables. Reference tables by the names chembl_get_bioactivities returned.
canvas_idYesCanvas ID returned by chembl_get_bioactivities — non-null whenever that call staged a table.

Output Schema

NameRequiredDescriptionDefault
rowsNoResult rows (capped at the canvas row limit). Each row is a column→value map.
errorNoPresent when the call failed. Absent on success.
row_countNoNumber of rows materialized in this response.
truncatedNoTrue when the SQL result exceeded the canvas row cap and was truncated — the engine bounding the result set itself, not the rendering. Independent of rendered_rows; page past it with LIMIT/OFFSET.
rendered_rowsNoHow many of those rows the markdown table in content[] holds. Below row_count when the rendered table reached its character budget — a rendering bound, INDEPENDENT of truncated: a response can be truncated:false and still render fewer rows than row_count. Re-run the same SQL with LIMIT/OFFSET to read the rows past it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `canvas_disabled`: Called while CANVAS_PROVIDER_TYPE is not duckdb, so no canvas exists. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `canvas_disabled`: The server runs with the canvas off (CANVAS_PROVIDER_TYPE=none), so no canvas exists. Other values are possible when a failure originates below the handler."
  2. Changed1 schema field changed
    • changedInput schema / properties / canvas_id / description
      Previous value: -"Canvas ID returned by chembl_get_bioactivities (spilled: true)."New value: +"Canvas ID returned by chembl_get_bioactivities — non-null whenever that call staged a table."
  3. Changed1 schema field changed
    • addedInput schema / properties / canvas_id / pattern
      Added value: +"^[A-Za-z0-9_-]{10}$"
  4. Changed6 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / additionalProperties
      Added value: +false
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedOutput schema / anyOf
      Added value: +[
      +  {
      +    "not": {
      +      "required": [
      +        "error"
      +      ]
      +    },
      +    "required": [
      +      "rows",
      +      "row_count",
      +      "rendered_rows",
      +      "truncated"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "error"
      +    ]
      +  }
      +]
    • addedOutput schema / properties / error
      Added value: +{
      +  "additionalProperties": {},
      +  "description": "Present when the call failed. Absent on success.",
      +  "properties": {
      +    "code": {
      +      "description": "JSON-RPC error code for this failure.",
      +      "maximum": 9007199254740991,
      +      "minimum": -9007199254740991,
      +      "type": "integer"
      +    },
      +    "data": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "reason": {
      +          "description": "Machine-readable failure mode. Declared by this tool: `canvas_disabled`: Called while CANVAS_PROVIDER_TYPE is not duckdb, so no canvas exists. Other values are possible when a failure originates below the handler.",
      +          "examples": [
      +            "canvas_disabled"
      +          ],
      +          "type": "string"
      +        },
      +        "recovery": {
      +          "additionalProperties": {},
      +          "description": "Actionable next step for the caller.",
      +          "properties": {
      +            "hint": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "hint"
      +          ],
      +          "type": "object"
      +        },
      +        "retryable": {
      +          "description": "Whether retrying may succeed.",
      +          "type": "boolean"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "message": {
      +      "description": "Human-readable description of what went wrong.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "code",
      +    "message"
      +  ],
      +  "type": "object"
      +}
    • removedOutput schema / required
      Removed value: -[
      -  "rows",
      -  "row_count",
      -  "rendered_rows",
      -  "truncated"
      -]
  5. Changed3 schema fields changed
    • addedOutput schema / properties / rendered_rows
      Added value: +{
      +  "description": "How many of those rows the markdown table in content[] holds. Below row_count when the rendered table reached its character budget — a rendering bound, INDEPENDENT of truncated: a response can be truncated:false and still render fewer rows than row_count. Re-run the same SQL with LIMIT/OFFSET to read the rows past it.",
      +  "type": "number"
      +}
    • changedOutput schema / properties / truncated / description
      Previous value: -"True when the SQL result exceeded the canvas row cap and was truncated."New value: +"True when the SQL result exceeded the canvas row cap and was truncated — the engine bounding the result set itself, not the rendering. Independent of rendered_rows; page past it with LIMIT/OFFSET."
    • changedOutput schema / required
      Previous value: -[
      -  "rows",
      -  "row_count",
      -  "truncated"
      -]New value: +[
      +  "rows",
      +  "row_count",
      +  "rendered_rows",
      +  "truncated"
      +]
  6. First observed

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only cover safety (readOnly, idempotent); the description adds genuinely new behavior: two independent result bounds (truncated vs. rendered_rows relative to row_count), that offsets can reach rows beyond the canvas row cap, and an availability precondition. This is exactly the context annotations cannot convey.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose, then scoping, then result-bound semantics, then pagination recipe — a sensible order. Density is high and a couple of clauses (the example query, the rendered_rows parenthetical) are long, but each carries actionable information rather than filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Output schema exists, yet the description still explains the two result-bound fields an agent would otherwise misread, plus pagination and the unavailability condition. Nothing needed to call this correctly or interpret its bounds is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3; the description earns more by naming the concrete staged table identifiers (bioactivities and bioactivities_null_potency views) and supplying a real SQL example, which clarifies how the `sql` parameter should reference staged names. It doesn't add anything about canvas_id beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb and resource ('Run a read-only SQL SELECT over the bioactivity rows chembl_get_bioactivities staged') and immediately distinguishes itself from the inline preview and from chembl_dataframe_describe. An agent can tell exactly which of the sibling tools performs full-set aggregation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to use it ('across the FULL set, not the inline preview'), routes table discovery to chembl_dataframe_describe, gives concrete pagination instructions with LIMIT/OFFSET syntax, and names the one condition under which the tool is unusable (CANVAS_PROVIDER_TYPE=none). No inference required.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.