Skip to main content
Glama
stand-out-of-my-sun

Diogenes Database Intelligence, SQL Engine & Schema Guard MCP

Database Index Advisor & Composite B-Tree Optimizer

recommend_database_indexes
Read-onlyIdempotent

Analyzes slow SQL queries and recommends single-column or composite B-tree/BRIN indexes from WHERE, JOIN, and ORDER BY clauses to reduce full-table scans and improve response times.

Instructions

Recommends optimal single-column and composite B-Tree/BRIN indexes based on slow query WHERE, JOIN, and ORDER BY clauses. Use when optimizing database response times and eliminating full-table scans; for inspecting full execution plans, use analyze_query_plan instead. Stateless read-only edge call (max 32 KB, 60 RPM): accepts 'slow_queries_or_workload' ('index_type_preference' defaults to 'btree_and_composite'), supports '?demo=true' or L402 (15 sats), and returns HTTP 400 if invalid.

Input Schema

NameRequiredDescriptionDefault
max_new_indexesNoMaximum number of index creation statements to recommend.
index_type_preferenceNoTarget indexing strategy: B-tree and composite, BRIN and GIN sparse, or covering indexes with INCLUDE.
slow_queries_or_workloadYesCollection of slow SQL queries or workload log statements to analyze for index gaps.

Output Schema

NameRequiredDescriptionDefault
recommended_indexesYesList of recommended CREATE INDEX DDL statements with target columns.
storage_overhead_estYesEstimated index disk storage footprint overhead impact.
expected_speedup_factorYesEstimated average query execution speedup multiple (e.g. 14.5x).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive/closed-world, but the description adds substantial context beyond them: stateless edge call, 32 KB payload cap, 60 RPM rate limit, demo mode, L402 payment of 15 sats, and HTTP 400 on invalid input. That is exactly the operational detail annotations cannot convey.

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?

Front-loaded with purpose and routing before the operational clauses, and every sentence carries information. It borders on dense with the payment/limit parenthetical, but nothing is redundant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be described. The description supplies rate limits, size cap, payment/auth model, and error behavior, leaving nothing an agent needs in order to invoke it correctly.

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 each parameter is already documented. The description names 'slow_queries_or_workload' and states the default for 'index_type_preference', adding marginal value, but does not add syntax or format detail beyond what the schema provides. Baseline 3 is appropriate.

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 (Recommends) plus resource (single-column and composite B-Tree/BRIN indexes) and even the input basis (WHERE, JOIN, ORDER BY clauses). The final clause routes the agent to the sibling analyze_query_plan, so it is distinguishable from related tools without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says when to use it ('optimizing database response times and eliminating full-table scans') and names the alternative for a different need ('for inspecting full execution plans, use analyze_query_plan instead'). Both the use case and the exclusion are spelled out.

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