MCP server for dataxplan: read PostgreSQL EXPLAIN plans for AI agents (bottlenecks, estimation errors, fixes, charts).
Server has 5 tools with complete schemas and descriptions. Tool names are action-oriented (analyze_plan, compare_plans, plan_tree, describe_inputs, plan_chart). Descriptions are substantive (100-250 chars), explaining WHAT and WHEN. Input schemas use Pydantic with types and descriptions. However, output schemas are not documented, LLMs cannot predict return structure. Error handling is minimal (basic try-catch returning error dicts). No parameter constraints (enums, ranges). Tool annotations present but limited. Missing: pagination guidance, output schema documentation, actionable error messages, parameter validation rules.
Analyse a PostgreSQL EXPLAIN plan: bottlenecks, estimation errors and findings. ``plan`` is the output of ``EXPLAIN (ANALYZE, BUFFERS, FORMAT JSON) ...`` (text, YAML and XML are also accepted). Optional ``context`` (table sizes, indexed columns, stale stats) sharpens the findings; ``thresholds`` overrides the rule cut-offs (see describe_inputs).
Compare two plans for regression: timing, plan shape, estimates and findings.
How to produce the plan, the accepted formats, the findings and thresholds.
Render the self-time-per-node chart for a plan as a PNG image.
The plan as an annotated text tree (self time, rows, flags per node).
Output schemas not documented. LLMs cannot predict return structure (dict vs string vs bytes). analyze_plan returns dict with 'summary' field; plan_tree returns string; plan_chart returns bytes. No schema documentation in tool descriptions or code comments.
Error handling lacks recovery guidance. analyze_plan catches ValueError/TypeError/ImportError and returns {'error': str(exc), 'hint': _HINT}. The hint 'call describe_inputs for how to produce the plan' is generic and does not tell LLM what to do next (retry? ask user? try different format?).
No parameter constraints or validation rules documented. 'plan' parameter accepts string but no format/length guidance. 'thresholds' is dict[str, float] with no enum of valid threshold keys or range constraints (min/max values). LLMs cannot validate inputs before calling.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | D | 56 | 2026-07-28+ | v2 |
plan_chart description is vague ('Render the self-time-per-node chart for a plan as a PNG image'). Does not explain when to use it vs plan_tree, what the chart shows, or that output is binary PNG bytes (not text/JSON).
compare_plans description is minimal (11 words). Does not explain what 'regression' means in this context, what fields are compared, or when to call it vs analyze_plan. Lacks WHEN guidance.