Skip to main content
Glama
Eszetael

postgres-mcp-hardened

Would this index help?

simulate_index
Read-onlyIdempotent

Simulate an index's effect on a query plan without creating it, showing estimated costs and whether the planner would use it.

Instructions

Answers whether an index would change the plan for a given query — WITHOUT creating it. Uses the hypopg extension, which registers the index in backend memory only: the planner sees it, storage never does, and it is gone when the call returns. Give the query, the table and the columns; the index definition is assembled here, so there is no way to send DDL through this tool. Returns the plan and cost with and without, and whether the planner actually reached for it — a cost that barely moves and an index the planner ignored are different answers. These are planner ESTIMATES, not measured times: treat a big improvement as a reason to test the index, not as proof. Needs hypopg installed; says so plainly, with the package name, when it is missing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesthe read-only query the index is supposed to help
tableYesthe table to index, `schema.table` or just `table` (defaults to the `schema` field, then to public)
usingNoaccess methodbtree
schemaNoused only when `table` is unqualifiedpublic
columnsYescolumn names, in index order
databaseNowhich configured database to use; omit when only one is configured
Behavior5/5

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

The description goes far beyond the readOnly/idempotent/destructive annotations by explaining the hypopg mechanism: index registered in backend memory only, gone when the call returns. It also discloses the failure mode if hypopg is missing and clarifies that results are planner estimates, not measured times. This aligns with annotations with no contradiction.

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?

The description is dense yet well-structured, front-loading purpose and safety, then covering inputs, outputs, interpretation, and prerequisites. Every sentence earns its place; there is no filler or repetition.

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?

Given no output schema, the description fully explains what is returned: plan and cost with and without, plus whether the planner used the index. It also covers prerequisite, absence of side effects, and interpretation nuance, making it complete for a complex tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already covers 100% of parameters with descriptions, so baseline is 3. The description adds value by stating 'the index definition is assembled here,' clarifying that users supply table and columns rather than a full DDL statement, which goes beyond the schema's individual parameter descriptions.

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 'Answers whether an index would change the plan for a given query — WITHOUT creating it,' a specific verb and resource. It explicitly distinguishes itself from sibling tools like analyze_indexes and explain_query by emphasizing 'the planner sees it, storage never does,' making the hypothetical nature unmistakable.

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?

It gives clear usage guidance: provide query, table, and columns; the index is assembled automatically; no DDL can be sent. It also warns that these are estimates, not proof. However, it does not explicitly name alternative tools or state when not to use this tool, 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.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Eszetael/postgres-mcp-hardened'

If you have feedback or need assistance with the MCP directory API, please join our Discord server