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

MCPg - Production-grade PostgreSQL MCP Server

Read PG buffercache summary

read_pg_buffercache_summary
Read-only

Summarize PostgreSQL shared buffer cache usage, reporting total, free, used, and dirty buffers plus average usage count. Requires pg_buffercache; returns available=false when not installed.

Instructions

Read a high-level summary of the PostgreSQL shared buffer cache usage. Reports total buffers, free/used buffers, dirty buffers, and average usage count. Requires the pg_buffercache extension. If not installed, returns available=false.

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": "read_pg_buffercache_summary"
  }
}

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
availableYes
free_buffersNo
used_buffersNo
dirty_buffersNo
total_buffersNo
average_usage_countNo

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

A3.8/5.0
Behavior4/5

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

Annotations already establish readOnlyHint=true and openWorldHint=false, so safety is covered. Beyond that, the description adds real behavioral content: the pg_buffercache extension prerequisite and the graceful-degradation contract ('returns available=false' when absent), which an agent cannot learn from the schema or annotations. It stops short of describing buffer units (pages vs bytes) or what 'average usage count' means operationally.

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 short sentences, front-loaded with what the tool returns, then the prerequisite, then the failure mode. Every sentence carries information an agent needs, and nothing is repeated from the title or schema.

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 single-optional-parameter read tool with an output schema and full annotation coverage, the definition is nearly complete: purpose, returned metrics, extension dependency, and degraded response are all covered. The only minor gaps are metric units/semantics for 'usage count' and no explicit pointer to the relations-level sibling for drill-down.

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 only one optional parameter and schema description coverage is 100%, with the schema already explaining that it targets a configured read-only secondary database and that non-id names are rejected. The description adds nothing about the database parameter, so it sits at the baseline for fully documented schemas.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Specific verb ('Read') plus resource ('PostgreSQL shared buffer cache usage') and scope qualifier ('high-level summary'), and it enumerates the reported metrics (total, free/used, dirty, average usage count). It implicitly contrasts with the per-relation sibling read_pg_buffercache_relations via 'high-level summary', but never names that sibling, so differentiation relies on inference.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

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

Usage is only implied: 'high-level summary' suggests this is the aggregate view rather than the per-relation view, and the extension prerequisite is stated as a precondition. There is no explicit 'use this instead of X' routing to read_pg_buffercache_relations, no when-not guidance, and no tie-in to diagnostic workflows such as cache-hit troubleshooting.

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