Skip to main content
Glama

Suggest a PostgreSQL index

postgres_index_suggestions
Read-only

Generate CREATE INDEX CONCURRENTLY SQL for a PostgreSQL table column when queries filter an unindexed column or analysis flags a missing index; includes partial index variant and ANALYZE reminder.

Instructions

Generates the exact CREATE INDEX CONCURRENTLY SQL for a PostgreSQL table column, including a partial index variant and a post-creation ANALYZE reminder. Call this when the analyzer flags a missing index finding or when writing a query that filters on a column without an existing index. Does not verify whether the index already exists.

Input Schema

NameRequiredDescriptionDefault
tableYesPostgreSQL table name
columnYesColumn name to index

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=true and openWorldHint=false, and the description is consistent with them (it emits SQL rather than executing DDL). It adds genuinely useful behavior beyond the annotations: the output includes a partial index variant and a post-creation ANALYZE reminder, and it discloses the limitation that existing indexes are not checked.

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?

Three sentences, all load-bearing: what is produced, when to call it, and the explicit non-guarantee. The output composition is front-loaded ahead of the usage guidance.

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 no output schema, the description correctly fills that gap by enumerating what is returned (CREATE INDEX CONCURRENTLY SQL, partial variant, ANALYZE reminder). Combined with the existence-check caveat, an agent has enough to call and interpret results; only pagination/return-shape mechanics are absent and largely irrelevant for a two-string-input generator.

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% for both params ('PostgreSQL table name', 'Column name to index'), so the schema already carries the parameter meaning. The description restates 'table column' without adding format, qualification, or naming-convention detail, so baseline 3 applies.

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 artifact (generates the exact CREATE INDEX CONCURRENTLY SQL) for a specific resource (PostgreSQL table column), and names sibling-adjacent alternatives implicitly by being PostgreSQL-specific against suggest_gsi/suggest_mongo_index/mysql_index_suggestions. An agent can distinguish it from all listed siblings 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 Guidelines4/5

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

Gives two concrete invocation triggers ('when the analyzer flags a missing index finding' or 'when writing a query that filters on a column without an existing index') and one exclusion ('Does not verify whether the index already exists'). It stops short of explicitly naming sibling tools as alternatives, but the when-to-use conditions are clear.

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