Skip to main content
Glama

explainSql

Read-only

Generate a non-executing query plan for a SQL statement on an omni-sql connection to inspect how the database would run it without running it.

Instructions

Generate a non-executing query plan on an Omni SQL connection (the active one unless connectionId is given).

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": {
      "sql": "<sql>"
    },
    "name": "explainSql"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYes
connectionIdNoConnection id from listConnections. Omit to use the active connection.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.24.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, and 'non-executing' is consistent with that. The description adds the useful default that the active connection is used when connectionId is omitted, but says nothing about what the plan contains, whether the SQL is validated against the schema, or any cost/latency behavior.

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 front-loaded sentence with no filler, and the connection default is parenthetically attached where it belongs. It is efficient, though it is short enough that more could have been said without bloat.

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?

For a simple two-parameter read-only tool this covers the essentials, but with no output schema the description should say what a 'query plan' return looks like so an agent knows what to expect. That return-format gap is the main missing piece.

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 50%: connectionId is documented in the schema, and the description's note about falling back to the active connection largely repeats it. The required 'sql' parameter has no description in either place, so the description does not compensate for that gap beyond implying it is the statement to be planned.

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?

The description gives a specific verb and resource ('Generate a non-executing query plan') and scopes it to an Omni SQL connection. The word 'non-executing' implicitly separates it from executeSql, though no sibling is named explicitly.

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?

Usage is only implied: the agent must infer that this is the tool to pick when a plan is wanted without running the statement. The only stated conditional ('the active one unless connectionId is given') is about connection resolution, not about when to prefer this tool over executeSql or getActiveSql.

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