Skip to main content
Glama

get-execution-plan

get-execution-plan
Read-onlyIdempotent

Inspect a Firebird SELECT query's optimizer plan in a read-only transaction without executing it; unavailable plans return an error, not an execution fallback.

Instructions

Prepares an authorized SELECT in a read-only transaction and retrieves its optimizer plan without executing it. Parameters are not bound; unavailable plans return an error, never an execution fallback.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesAuthorized SELECT-first statement to prepare, not execute; WITH/CTE and writes are not supported
paramsNoRetained for compatibility/auditing; values are not bound for prepare-only plans

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNoFailure information; present when success is false
resultNoThe legacy JSON payload; present for completed operations and partial batches
successYesFalse for tool failures, including partially failed batches

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv2.12.3
    • changedInput schema / properties / params / description
      Previous value: -"Parameters for parameterized queries"New value: +"Retained for compatibility/auditing; values are not bound for prepare-only plans"
    • changedInput schema / properties / sql / description
      Previous value: -"SQL query to analyze"New value: +"Authorized SELECT-first statement to prepare, not execute; WITH/CTE and writes are not supported"
  2. Changed5 schema fields changedv2.12.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • removedInput schema / additionalProperties
      Removed value: -false
    • removedInput schema / properties / params / items / anyOf
      Removed value: -[
      -  {
      -    "anyOf": [
      -      {
      -        "type": [
      -          "string",
      -          "number"
      -        ]
      -      },
      -      {
      -        "type": "boolean"
      -      }
      -    ]
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / params / items / type
      Added value: +[
      +  "string",
      +  "number",
      +  "boolean",
      +  "null"
      +]
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$defs": {
      +    "__schema0": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "number"
      +        },
      +        {
      +          "type": "boolean"
      +        },
      +        {
      +          "type": "null"
      +        },
      +        {
      +          "items": {
      +            "$ref": "#/$defs/__schema0"
      +          },
      +          "type": "array"
      +        },
      +        {
      +          "additionalProperties": {
      +            "$ref": "#/$defs/__schema0"
      +          },
      +          "propertyNames": {
      +            "type": "string"
      +          },
      +          "type": "object"
      +        }
      +      ]
      +    },
      +    "__schema1": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "number"
      +        },
      +        {
      +          "type": "boolean"
      +        },
      +        {
      +          "type": "null"
      +        },
      +        {
      +          "items": {
      +            "$ref": "#/$defs/__schema1"
      +          },
      +          "type": "array"
      +        },
      +        {
      +          "additionalProperties": {
      +            "$ref": "#/$defs/__schema1"
      +          },
      +          "propertyNames": {
      +            "type": "string"
      +          },
      +          "type": "object"
      +        }
      +      ]
      +    }
      +  },
      +  "$schema": "https://json-schema.org/draft/2020-12/schema",
      +  "additionalProperties": false,
      +  "properties": {
      +    "error": {
      +      "additionalProperties": false,
      +      "description": "Failure information; present when success is false",
      +      "properties": {
      +        "details": {
      +          "additionalProperties": {
      +            "$ref": "#/$defs/__schema1"
      +          },
      +          "propertyNames": {
      +            "type": "string"
      +          },
      +          "type": "object"
      +        },
      +        "message": {
      +          "type": "string"
      +        },
      +        "type": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "message",
      +        "type"
      +      ],
      +      "type": "object"
      +    },
      +    "result": {
      +      "additionalProperties": false,
      +      "description": "The legacy JSON payload; present for completed operations and partial batches",
      +      "properties": {
      +        "analysis": {
      +          "type": "string"
      +        },
      +        "error": {
      +          "type": "string"
      +        },
      +        "plan": {
      +          "type": "string"
      +        },
      +        "planDetails": {
      +          "items": {
      +            "$ref": "#/$defs/__schema0"
      +          },
      +          "type": "array"
      +        },
      +        "query": {
      +          "type": "string"
      +        },
      +        "success": {
      +          "type": "boolean"
      +        }
      +      },
      +      "required": [
      +        "query",
      +        "plan",
      +        "planDetails",
      +        "success",
      +        "analysis"
      +      ],
      +      "type": "object"
      +    },
      +    "success": {
      +      "description": "False for tool failures, including partially failed batches",
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "success"
      +  ],
      +  "type": "object"
      +}
  3. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, yet the description adds non-obvious behavior: parameters are not bound, and an unavailable plan yields an error with 'never an execution fallback.' That failure-mode and no-fallback guarantee is exactly the kind of disclosure structured fields cannot express.

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?

Two tight sentences with zero filler. The core action is front-loaded and the constraints (non-binding params, error-over-fallback) follow in priority order.

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?

With an output schema present, return values need no explanation, and the description covers action, side-effect profile, and failure behavior. The only gap is guidance on when to prefer a sibling such as execute-query, which is minor for a read-only plan tool.

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%, so the schema already documents both parameters (sql semantics and params being non-binding). The description's 'Parameters are not bound' restates what the schema's params description already says, so this is the baseline 3 case rather than added value.

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?

The description opens with a specific verb and resource ('prepares an authorized SELECT... retrieves its optimizer plan') and immediately states the key differentiator 'without executing it.' An agent can tell this apart from execute-query purely from the text.

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?

The phrase 'without executing it' implicitly signals when to pick this tool over an execution sibling like execute-query, and 'authorized SELECT' sets a precondition. However, no sibling is named explicitly and there is no stated exclusion beyond the implicit contrast, so it falls short of a 5.

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