Skip to main content
Glama
oracle-mcp-server

oracle-mcp-server

by Tommi2Day

explain_plan

Displays Oracle optimizer execution plans for SQL statements without executing them, so you can inspect access paths and performance before running a query.

Instructions

Show the optimizer execution plan (EXPLAIN PLAN + DBMS_XPLAN.DISPLAY) of a SELECT, WITH, INSERT, UPDATE, DELETE or MERGE statement without executing it.

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": "explain_plan"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYesStatement to explain; bind variables (:1, :name) may stay unbound
formatNoDBMS_XPLAN format, e.g. TYPICAL (default), BASIC, ALL, ADVANCED, TYPICAL +OUTLINE

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations supplied, the description carries the full burden, and it does disclose the most important trait: the statement is not executed, so DML is safe to explain. It omits other relevant behavior such as required privileges (PLAN_TABLE/explain-plan access), that EXPLAIN PLAN itself writes rows into a plan table, and what the returned plan format looks like.

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 that names the action, the underlying mechanism, the accepted inputs, and the key non-execution guarantee, with no redundant wording.

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 two-parameter tool with no annotations and no output schema, the definition covers purpose and the no-execution guarantee but leaves out privilege requirements, the side effect on the plan table, and any hint about the shape of the returned plan beyond the 'format' enum values.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds real constraint meaning by enumerating the permitted statement kinds (SELECT, WITH, INSERT, UPDATE, DELETE, MERGE), which tells the agent DDL and other statements are out of scope. The 'format' parameter is left entirely to 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?

States a specific verb and resource ('Show the optimizer execution plan') and backs it with the concrete implementation (EXPLAIN PLAN + DBMS_XPLAN.DISPLAY) and the exact statement types accepted. It does not differentiate itself from the similarly named sibling 'sql_plan', so it stops short of a 5.

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 clause 'without executing it' implies the use case (safely inspect a plan, including for INSERT/UPDATE/DELETE/MERGE, without side effects), which is genuinely useful selection guidance. However, it never explicitly states when to prefer this over executing the statement or over any sibling tool, leaving the routing to inference.

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