Skip to main content
Glama
IBM watsonx.data MCP Server

IBM watsonx.data MCP Server

Official
by IBM

Explain Query

explain_query

Retrieve a SQL query execution plan from watsonx.data without executing the statement, so you can inspect, validate, and optimize queries before running them.

Instructions

Get query execution plan without running the query in watsonx.data.

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": {
      "engine_id": "<engine_id>",
      "statement": "<statement>"
    },
    "name": "explain_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
typeNoExplain type - "logical", "distributed", "validate", or "io"
formatNoOutput format - "json" or "text"
engine_idYesPresto or Prestissimo engine identifier
statementYesSQL query to explain. If query fails, consider using fully qualified table names (catalog.schema.table)
engine_typeNoEngine type - "presto" or "prestissimo" (default: "presto")presto

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.1.5
    • addedInput schema / properties / engine_id / description
      Added value: +"Presto or Prestissimo engine identifier"
    • addedInput schema / properties / engine_type / description
      Added value: +"Engine type - \"presto\" or \"prestissimo\" (default: \"presto\")"
    • addedInput schema / properties / format / description
      Added value: +"Output format - \"json\" or \"text\""
    • addedInput schema / properties / statement / description
      Added value: +"SQL query to explain. If query fails, consider using fully qualified table names (catalog.schema.table)"
    • addedInput schema / properties / type / description
      Added value: +"Explain type - \"logical\", \"distributed\", \"validate\", or \"io\""
  2. First observedv0.1.4

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden; it does disclose the most important trait, that the query is not executed, which is genuinely useful. It says nothing about required engine state, permissions, cost, or whether the plan is cached, leaving meaningful gaps for a 5-parameter tool.

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?

A single front-loaded sentence with zero filler; the key constraint (no execution) is placed where an agent will read it first.

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

Completeness3/5

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

An output schema exists and the input schema is fully documented, so return values and parameters need no prose. What is missing is the relationship to explain_analyze_query and any note on engine prerequisites, which matters given the tool's complexity and close sibling.

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 enum values for type, format, and engine_type, so the schema already documents every parameter. The description adds no meaning beyond it, which is the baseline 3 case.

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 ("Get query execution plan") plus a meaningful qualifier ("without running the query"), which tells an agent this is a non-executing inspection call. It does not, however, distinguish itself from the sibling explain_analyze_query, so the agent must infer the difference from the name alone.

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 phrase "without running the query" implies the usage context (safe plan inspection rather than execution), but there is no explicit when-to-use/when-not-to-use guidance and no mention of the obvious alternative explain_analyze_query. Usage is inferable but not stated.

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