Skip to main content
Glama
devopam

MCPg - Production-grade PostgreSQL MCP Server

Recommend IO method

recommend_io_method
Read-only

Recommends optimal PostgreSQL I/O method (sync, worker, io_uring) by analyzing workload cache miss ratio and reads per second, and generates ready-to-run SQL when change is needed.

Instructions

Recommend a PG 19 io_method ('sync' / 'worker' / 'io_uring') for the current workload. Reads pg_stat_database aggregates (blks_read / blks_hit / stats_reset) and the current setting, then maps the workload signals to one of: high_concurrent_read_load (→ io_uring), bursty_io_with_cache_pressure (→ worker), low_io_pressure (→ sync), current_setting_optimal (no change), or insufficient_stats (window too short). Read-only — never invokes ALTER SYSTEM; emits a ready_to_run_sql snippet the operator can paste when the recommendation differs from the current setting. Returns an object with available (bool), server_version_num, detail, and recommendations — a list of objects with recommended_method, reason, current_method, cache_miss_ratio, reads_per_second, stats_window_seconds, and ready_to_run_sql (null when no change suggested).

Example: recommend_io_method()

Input Schema

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
detailYes
availableYes
recommendationsYes
server_version_numYes
Behavior5/5

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

Annotations already set readOnlyHint=true, but the description adds rich behavioral context: it reads pg_stat_database aggregates, maps workload signals, and emits a ready_to_run_sql snippet without altering the system. It also details conditions like insufficient_stats and current_setting_optimal. 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 informative but slightly verbose, detailing the mapping logic and output object fields. It is well-structured, front-loading the purpose and then explaining behavior, but could be trimmed without losing clarity.

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 the tool's complexity (mapping workload to method, handling multiple scenarios), the description is thorough: it explains the inputs, the mapping rules, the output structure, and an example. The output schema is described in detail, so no gaps.

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?

With 100% schema coverage for the sole parameter (database), the baseline is 3. The description does not add additional meaning beyond what the schema provides, as the schema already includes a clear description. Thus the tool relies on the schema for parameter semantics.

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 states a specific verb ('Recommend') and resource ('PG 19 io_method'), and clearly defines the possible outputs (e.g., high_concurrent_read_load -> io_uring, bursty_io_with_cache_pressure -> worker, low_io_pressure -> sync). This distinguishes it from sibling tools, none of which focus on io_method recommendation.

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 recommending io_method based on current workload, and notes it is read-only (emitting SQL, not executing). It provides clear context but does not explicitly specify when not to use or list alternatives; however, given the niche purpose, this is sufficient.

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