Skip to main content
Glama

Run SQL query

draxlr_run_query
Read-onlyIdempotent

Run a read-only SQL query against a Draxlr database and return the resulting rows. Only read (SELECT) queries are allowed. Returns a queryId that can be passed to draxlr_save_query or draxlr_add_query_to_dashboard, and a url to view the query in Draxlr.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesThe SQL query to run. Must be a read-only (SELECT) query. If you add variables, write them as {{variableName}} using letters only (e.g. {{startDate}}); numbers, underscores and other special characters are not allowed. Pass their values in `variables`, or wrap each condition that uses a variable in [[ ]] (e.g. WHERE 1=1 [[AND created_at >= {{startDate}}]]) so it is skipped when no value is given.
pageNoPage number for pagination (default 1)
pageSizeNoRows per page (default 25)
variablesNoValues for the {{variables}} used in the SQL, keyed by variable name, e.g. { "startDate": "2026-01-01" }. Use an array for IN lists.
databaseIdYesThe database id (from draxlr_list_databases)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / sql / description
      Previous value: -"The SQL query to run. Must be a read-only (SELECT) query."New value: +"The SQL query to run. Must be a read-only (SELECT) query. If you add variables, write them as {{variableName}} using letters only (e.g. {{startDate}}); numbers, underscores and other special characters are not allowed. Pass their values in `variables`, or wrap each condition that uses a variable in [[ ]] (e.g. WHERE 1=1 [[AND created_at >= {{startDate}}]]) so it is skipped when no value is given."
    • addedInput schema / properties / variables
      Added value: +{
      +  "additionalProperties": {
      +    "anyOf": [
      +      {
      +        "type": "string"
      +      },
      +      {
      +        "type": "number"
      +      },
      +      {
      +        "type": "boolean"
      +      },
      +      {
      +        "items": {
      +          "type": [
      +            "string",
      +            "number"
      +          ]
      +        },
      +        "type": "array"
      +      }
      +    ]
      +  },
      +  "description": "Values for the {{variables}} used in the SQL, keyed by variable name, e.g. { \"startDate\": \"2026-01-01\" }. Use an array for IN lists.",
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnlyHint, idempotentHint, destructiveHint=false), so the description's job is to add beyond them. It does: it discloses that only SELECT is permitted and describes what the call returns (a queryId and a url), which is behavior the annotations do not convey. It omits failure modes and row-limit behavior.

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

Conciseness5/5

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

Three short sentences, each earning its place: purpose, the read-only restriction, and the return contract with downstream consumers. Front-loaded with the core action and no filler.

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

Completeness4/5

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

With no output schema, the description correctly compensates by explaining the returned queryId and url and their downstream use. Combined with a 100%-covered input schema and safety annotations, the definition is largely self-sufficient; only pagination-limit/error behavior is unaddressed.

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

Parameters3/5

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

Schema coverage is 100% and the sql parameter's schema description is very rich (variable syntax, [[ ]] conditional wrapping, variable typing), so the schema carries the parameter burden. The description adds no parameter-level detail beyond a general reference to variables, so the baseline 3 applies.

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 query against a Draxlr database and return the resulting rows') and scopes it precisely to SELECT-only. It also names the downstream tools that consume its output (draxlr_save_query, draxlr_add_query_to_dashboard), which helps separate it from sibling read tools like draxlr_run_saved_query.

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

Usage Guidelines4/5

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

The constraint 'Only read (SELECT) queries are allowed' effectively signals when the tool is not appropriate, and the return payload tells the agent this is the entry point for ad-hoc SQL. It never explicitly names an alternative (e.g. draxlr_run_saved_query for saved queries), so routing between the two 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.

Resources