Skip to main content
Glama
MCPg - Production-grade PostgreSQL MCP Server

MCPg - Production-grade PostgreSQL MCP Server

Monitor index build

monitor_index_build
Read-only

Track in-progress PostgreSQL index builds with phase, block/tuple counts, and progress percentage to diagnose slow HNSW or IVFFlat creation.

Instructions

Surface every active CREATE INDEX and its progress from pg_stat_progress_create_index (PG12+, no extension). One row per build with pid, schema.relation.index_name, the command, phase label, blocks_done/total, tuples_done/total, and a computed progress_pct (blocks first, tuples as fallback, null when neither phase reports a denominator). Useful next to list_active_queries when an HNSW / IVFFlat build on a big table is taking longer than expected. Returns a list of objects with pid, schema, relation, index_name, command, phase, blocks_done, blocks_total, tuples_done, tuples_total, and progress_pct (null when no denominator is reported).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "monitor_index_build"
  }
}

Input Schema

NameRequiredDescriptionDefault
databaseNoOptional: a database id from list_databases, to target a configured secondary (read-only) database; omit for the primary. Database names that are not configured ids are rejected.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.8.4
    • changedInput schema / properties / database / description
      Previous value: -"Optional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids."New value: +"Optional: a database id from list_databases, to target a configured secondary (read-only) database; omit for the primary. Database names that are not configured ids are rejected."
  2. First observedv0.6.8

TDQS

A4.2/5.0
Behavior5/5

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

Beyond readOnlyHint/openWorldHint, the description discloses the version floor (PG12+), that no extension is required, the one-row-per-build granularity, and the exact resolution logic for progress_pct (blocks first, tuples as fallback, null when no denominator). That computed-field rule is behavior an agent could not infer from the annotations or schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is front-loaded with the operational fact, but the column list is enumerated twice — once in prose ('pid, schema.relation.index_name, ... progress_pct') and again in the closing 'Returns a list of objects with ...' sentence. Since an output schema exists, that trailing enumeration is largely redundant and inflates the text.

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?

For a zero-required-parameter monitoring tool with annotations and an output schema, the description covers the essentials: source view, version requirement, row semantics, and progress computation. It is only weakened by duplicating return-field documentation that the output schema already provides.

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?

There is a single optional parameter whose schema description already covers the secondary-database targeting rule at 100% coverage, so the baseline of 3 applies. The description never mentions the `database` parameter, adding no meaning on top of the schema.

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 first sentence names a specific verb and source system: 'Surface every active CREATE INDEX and its progress from pg_stat_progress_create_index (PG12+, no extension).' It also enumerates the exact per-row shape, so an agent can distinguish this monitoring tool from catalog tools like list_indexes or activity tools like list_active_queries.

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?

The description gives a concrete triggering scenario: 'Useful next to list_active_queries when an HNSW / IVFFlat build on a big table is taking longer than expected.' That clarifies when to reach for it, but it stops short of explicit exclusions, e.g. what to use when no build is running or when the server is pre-PG12.

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

Deploy Server

Other Tools