Skip to main content
Glama
Cloady

Cloady

Official
by Cloady

Explain Engine Statement

explainEngineStatement
Destructive

Plans a database statement without executing it, using read-only EXPLAIN on Postgres or MySQL, and flags sequential scans on large tables to suggest an index from plan columns.

Instructions

Plans a statement from streamEngineStatements without running it: EXPLAIN (GENERIC_PLAN) in a read-only transaction on Postgres 16 and later, EXPLAIN FORMAT=JSON on the digest's sample text on MySQL. Flags a sequential scan with a filter on a table of 10,000 rows or more and suggests an index built from the plan's columns.

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": {
      "workspaceSlug": "<workspaceSlug>",
      "appSlug": "<appSlug>",
      "serviceName": "<serviceName>"
    },
    "name": "explainEngineStatement"
  }
}

Input Schema

NameRequiredDescriptionDefault
envNo
regionNo
appSlugYes
requestBodyNoThe JSON request body.
serviceNameYes
workspaceSlugYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.18.0

TDQS

C2.6/5.0
Behavior1/5

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

The description explicitly frames the operation as a read-only-planning step performed 'in a read-only transaction' and 'without running it', yet annotations declare readOnlyHint=false and destructiveHint=true. An agent trusting the annotations would treat a non-executing plan inspection as a destructive write, which is a direct conflict rather than added context.

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 that spends its words on the two things that matter: engine-specific mechanics and the index-suggestion behavior. It is dense but not padded; only the trailing scan-flagging clause could be trimmed without losing selection-critical information.

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

Completeness1/5

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

There is a meaningful gap between what is unknown and what the description supplies: six parameters (three of them required) with almost no schema documentation, no output schema, and no indication of what the returned plan/recommendation looks like beyond the seq-scan flag. Worst of all, the description's read-only framing is not reconciled with the destructive annotation, leaving the agent with no safe basis for deciding whether to call it.

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

Parameters2/5

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

Schema description coverage is only 17% across six parameters, so the description must compensate and it largely does not: workspaceSlug, appSlug, serviceName, env, region, and the nested requestBody are never explained. The only implicit parameter semantics is that the statement value comes from streamEngineStatements (matching the schema's 'An EngineStatement id'), which is a small gain over the schema.

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 names a specific verb and resource: it plans/explains a statement identified from streamEngineStatements without executing it, and clarifies the engine-specific mechanism (EXPLAIN GENERIC_PLAN on Postgres 16+, EXPLAIN FORMAT=JSON on MySQL). That distinguishes it from the sibling streamEngineStatements, though the alternative 'run it for real' path (runDbQuery) is never named.

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?

'Without running it' implies the use case: inspecting a plan before execution. However, there is no explicit when-to-use vs when-not guidance, no statement about which engines/versions are unsupported (pre-16 Postgres is only implied), and no pointer to the sibling that actually executes queries.

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

Deploy Server

Other Tools