Skip to main content
Glama

explain_plan

Generate an Oracle execution plan for a SQL statement without running it, using EXPLAIN PLAN and DBMS_XPLAN; surface errors if PLAN_TABLE is missing or inaccessible.

Instructions

Generate and return the Oracle execution plan for a SQL statement via EXPLAIN PLAN and DBMS_XPLAN, without executing the statement. Needs a PLAN_TABLE; if it is missing or the user lacks access, the failure is surfaced as an error result. Reports progress to clients that pass a progress token.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesThe SQL statement to plan (typically SELECT, INSERT, UPDATE, DELETE or MERGE).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.16.3

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full load and does well: it discloses non-execution of the target SQL, the PLAN_TABLE requirement, that missing table/access failures surface as error results, and that progress is reported to progress-token clients. It omits that EXPLAIN PLAN itself writes rows into PLAN_TABLE, which is a relevant side effect an agent should know.

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 tight sentences, front-loaded with the action and mechanism, then prerequisites and failure behavior. No filler and no repetition of 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 single-parameter tool with no output schema and no annotations, it covers action, mechanism, prerequisite, failure mode, and progress reporting. The remaining gap is the shape of the returned plan and the PLAN_TABLE write side effect.

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?

Only one parameter with 100% schema description coverage, so the schema already explains `sql` including the typical statement types. The description adds no syntax or formatting detail beyond that, so 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 (generate and return) plus resource (Oracle execution plan) and the exact mechanism (EXPLAIN PLAN and DBMS_XPLAN). The clause 'without executing the statement' cleanly separates it from siblings like run_query, execute_dml, or execute_dml_preview.

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?

Gives clear conditions for use: planning a statement without running it, and the PLAN_TABLE prerequisite. It stops short of naming alternatives such as suggest_index or run_sql_tuning_advisor, so it lacks explicit when-not guidance.

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