Skip to main content
Glama

scalix_db_query

Destructive

Execute a SQL query against the project database. Returns columns, rows, row count, and cost breakdown. Destructive statements (DROP/TRUNCATE/bulk DELETE) require a two-step confirmation: the first call returns code CONFIRMATION_REQUIRED with a confirmation_token — re-call with that value in confirm_token to execute.

Input Schema

NameRequiredDescriptionDefault
sqlYesSQL query to execute
paramsNoBind parameters for the query
timeline_idNoF17: run the query against a BRANCH timeline of this project instead of the primary. Takes the timeline_id returned by scalix_db_branch_create (or its db_<timeline_id> form). A timeline that is not a branch of this project fails the call — it never falls back to the primary. Omit for the primary.
confirm_tokenNoConfirmation token from a prior CONFIRMATION_REQUIRED response; required to execute destructive SQL (single-use, short TTL)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / timeline_id
      Added value: +{
      +  "description": "F17: run the query against a BRANCH timeline of this project instead of the primary. Takes the timeline_id returned by scalix_db_branch_create (or its db_<timeline_id> form). A timeline that is not a branch of this project fails the call — it never falls back to the primary. Omit for the primary.",
      +  "type": "string"
      +}
  2. Changed1 schema field changed
    • addedInput schema / properties / confirm_token
      Added value: +{
      +  "description": "Confirmation token from a prior CONFIRMATION_REQUIRED response; required to execute destructive SQL (single-use, short TTL)",
      +  "type": "string"
      +}
  3. First observed

TDQS

A4/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, but the description adds the non-obvious protocol an agent must follow: a first call returning code CONFIRMATION_REQUIRED with a confirmation_token, then a re-call passing confirm_token. It also discloses the response contents (columns, rows, row count, cost breakdown) and notes the token is single-use with a short TTL — information unavailable in the annotations.

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 sentences, front-loaded: purpose and return values first, then the destructive-confirmation escape hatch. No filler and nothing redundant with the schema.

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?

For a 4-parameter mutation tool with no output schema, the description covers the return payload and the two-step destructive flow, which are the two highest-risk unknowns. It omits any mention of authorization requirements or query limits/rate limits, a minor gap given how rich the annotations and schema already are.

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 description coverage is 100%, including the branch-timeline semantics for timeline_id and the single-use nature of confirm_token, so the schema already carries the parameter burden. The description reinforces confirm_token's role in the two-step flow but adds no syntax, format, or binding detail beyond the schema. Baseline 3 applies.

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

Purpose4/5

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

States a specific verb and resource ('Execute a SQL query against the project database') and even enumerates the return shape, so the agent knows exactly what this does. It does not, however, distinguish itself from the sibling scalix_db_text_to_sql, which also produces SQL against the project database.

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

Usage Guidelines3/5

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

The description explains the conditional flow for destructive statements (DROP/TRUNCATE/bulk DELETE trigger CONFIRMATION_REQUIRED), which is real usage guidance. It never says when to choose this over scalix_db_text_to_sql, scalix_db_schema, or scalix_db_table, and offers no exclusions or prerequisites such as required permissions.

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.