Skip to main content
Glama

fb_explain_plan

Compiles Firebird SQL queries, extracts execution plans, and analyzes NATURAL SCAN or SORT steps to recommend indexes and query rewrites.

Instructions

Compila uma consulta SQL no Firebird e extrai o plano de execução compilado (PLAN). Analisa leituras sequenciais (NATURAL SCAN) em tabelas, ordenações em memória (SORT) e fornece recomendações cirúrgicas de indexação e reescrita. Se houver múltiplos bancos no projeto e nenhum estiver ativo na sessão, pergunte antes ao usuário.

Input Schema

NameRequiredDescriptionDefault
sqlYes
db_aliasNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses what the tool analyzes and returns (plan, NATURAL SCAN/SORT findings, recommendations), which is genuinely informative, but it never states whether the SQL is actually executed or only compiled, nor any permission/side-effect implications for a potentially mutating statement.

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?

Three short sentences that front-load the core action (compile + extract plan) before the analysis and the ambiguity-handling instruction. No filler, though the final conditional could be integrated more tightly.

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?

With no annotations, no output schema, and 0% parameter coverage, the description should work harder. It adequately conveys purpose and the main output categories, but omits whether the query executes, the interpretation of db_alias, and any input format expectations, leaving real gaps for an agent to fill by inference.

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 0% and neither parameter is documented in the schema. The description only indirectly gestures at db_alias via the 'multiple databases / no active database' instruction, and says nothing about the required sql parameter's form or constraints, leaving the schema's gaps unfilled.

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 and resource: it compiles a SQL query in Firebird and extracts the compiled execution plan (PLAN), then analyzes NATURAL SCAN and SORT operations and gives indexing/rewrite recommendations. This clearly separates it from siblings like fb_query (execution) and fb_inspect_table (schema inspection).

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?

It gives one concrete conditional instruction (ask the user when multiple databases exist and none is active in the session), which is useful context. However, it never states when to choose this over fb_query or fb_inspect_table, nor any prerequisite for the SQL input; usage is only implied by the analysis-oriented purpose.

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