Skip to main content
Glama
devopam

MCPg - Production-grade PostgreSQL MCP Server

Recommend prewarm targets

recommend_prewarm_targets
Read-only

Identifies PostgreSQL relations that would benefit from pg_prewarm by analyzing cache miss rates and sequential scan patterns, then recommends prewarm targets within a configurable shared_buffers budget.

Instructions

Recommend relations whose first-query latency would benefit from pg_prewarm. Inspects pg_stat_user_tables + pg_statio_user_tables to find high cold-miss-rate / seq_scan-dominant relations, and caps the cumulative cost at shared_buffers_budget_pct * shared_buffers so the recommendation never silently exceeds shared_buffers. The advisor is read-only — never invokes pg_prewarm itself. Returns an object with shared_buffers_blocks (configured shared_buffers in 8 KiB pages), budget_blocks (the cap), total_cost_blocks (sum of recommendations actually returned), and candidates — a list of objects with schema, relation, reason (seq_scan_dominant / high_cold_miss_rate / small_hot_relation_uncached / index_in_critical_path), prewarm_mode, estimated_buffer_cost, heap_blks_read, heap_blks_hit, cache_miss_ratio, and ready_to_run_sql.

Example: recommend_prewarm_targets(shared_buffers_budget_pct=60.0, limit=10)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
databaseNoOptional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids.
prewarm_modeNobuffer
min_heap_blks_readNo
shared_buffers_budget_pctNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
candidatesYes
budget_blocksYes
total_cost_blocksYes
shared_buffers_blocksYes
Behavior5/5

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

The description explicitly states it never invokes pg_prewarm and is read-only, aligning with readOnlyHint=true. It details the algorithm and budget capping, adding value beyond annotations with no contradictions.

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?

The description is detailed and well-structured, front-loading the purpose and then explaining algorithm and output. While informative, it could be slightly more concise without losing clarity.

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 recommendation tool with 5 optional parameters, the description covers functionality, algorithm, and output structure comprehensively. Missing details on prewarm_mode behavior, but otherwise complete.

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?

With only 20% schema coverage, the description compensates by explaining shared_buffers_budget_pct and limit via example, but does not cover prewarm_mode or min_heap_blks_read. The output schema is described in detail.

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 specifies the tool recommends relations for pg_prewarm based on cold-miss rates and seq_scan dominance, using specific system tables. It clearly distinguishes from sibling tools like list_prewarmed_relations and get_prewarm_extension_status.

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 explains the tool is for advisory purposes and is read-only, but does not explicitly state when not to use it or mention alternatives. The sibling tools exist, but the description could provide clearer usage context.

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/devopam/MCPg'

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