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 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

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, 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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedOutput schema / anyOf
      Previous value: -[
      -  {
      -    "not": {
      -      "required": [
      -        "error"
      -      ]
      -    },
      -    "required": [
      -      "rows",
      -      "row_count",
      -      "rendered_rows",
      -      "truncated"
      -    ]
      -  },
      -  {
      -    "required": [
      -      "error"
      -    ]
      -  }
      -]New value: +[
      +  {
      +    "not": {
      +      "required": [
      +        "error"
      +      ]
      +    },
      +    "required": [
      +      "rows",
      +      "row_count",
      +      "truncated"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "error"
      +    ]
      +  }
      +]
    • removedOutput schema / properties / rendered_rows
      Removed 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 — the engine bounding the result set itself, not the rendering. Independent of rendered_rows; page past it with LIMIT/OFFSET."New value: +"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."
  2. 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."
  3. 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."
  4. Changed1 schema field changed
    • addedInput schema / properties / canvas_id / pattern
      Added value: +"^[A-Za-z0-9_-]{10}$"
  5. 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"
      -]
  6. 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"
      +]
  7. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already cover the read-only/idempotent/closed profile, but the description adds substantial context beyond them: results return on both structuredContent and content[], a canvas row cap exists, truncated signals when it was exceeded, and paging must be done via ORDER BY a unique column plus LIMIT/OFFSET inside the query since offsets reach rows past the cap. That is exactly the operational behavior an agent needs to avoid silently truncated analysis.

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?

A single dense paragraph, but front-loaded with the action and scoping constraint, then behavior, then paging, then availability — a sensible order. The inline example SQL is long but is the highest-value content here since it demonstrates the dedupe aggregate idiom, so it earns its space.

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?

Given a two-parameter tool with an output schema, the description still covers the pieces the output schema cannot: result delivery channels, the truncated/row-cap contract, and the paging idiom. An agent has enough to invoke it correctly and to handle large results without guessing.

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, but the description adds real meaning the schema lacks: the staging name mapping (bioactivities for the potency_ranked view, bioactivities_null_potency for null_potency) that determines how sql must be written. It stops short of documenting any SQL dialect quirks or column types, which the describe sibling covers.

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?

States a specific verb and resource (run a read-only SQL SELECT over bioactivity rows staged by chembl_get_bioactivities on a canvas) and immediately scopes it against the inline preview, which is the key ambiguity for this tool. An agent can tell it apart from chembl_dataframe_describe and chembl_get_bioactivities without opening a schema.

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?

Explicit when-to-use (rank/group/dedupe/aggregate across the FULL set rather than the preview), explicit routing to the alternative (discover staged tables and columns with chembl_dataframe_describe), and an explicit when-not condition (unavailable when CANVAS_PROVIDER_TYPE=none). Nothing material is left to inference.

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.