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

MCPg - Production-grade PostgreSQL MCP Server

Read PG buffercache relations

read_pg_buffercache_relations
Read-only

Identify which PostgreSQL relations consume shared buffer cache, reporting buffered size, cache percentage, usage count, and dirty pages, with optional schema filtering.

Instructions

Read the list of database relations taking up the most space in the PostgreSQL shared buffer cache. Reports buffered size, percentage of shared buffers, percent of relation buffered, average usage count, and dirty pages. Allows filtering by schema. 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_relations"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo
schemaNo
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
relationsYes

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.7/5.0
Behavior4/5

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

Beyond readOnlyHint=true and openWorldHint=false, the description discloses the extension dependency and the graceful degradation path ('If not installed, returns available=false'), which is exactly the kind of failure behavior an agent needs. It adds no detail on row limits or cost of the scan, so it is strong but not complete.

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?

Four short sentences, front-loaded with the purpose, then outputs, then filter, then prerequisite and failure mode. No filler, though the list of reported metrics is slightly dense and the ordering of the extension note could be earlier since it gates success.

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?

With an output schema present, the description needn't spell out return shapes, yet it still names the key columns and the available=false fallback. The only real gap is the semantics of the limit parameter, which is left ambiguous for a read tool with a default row cap.

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?

Only the database parameter is documented in the schema (coverage 33%). The description compensates for the 'schema' parameter by stating it filters by schema, but says nothing about 'limit' (default 100) — whether it caps rows returned or the number of relations ranked. Partial compensation justifies the baseline 3.

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?

The description opens with a specific verb and resource ('Read the list of database relations taking up the most space in the PostgreSQL shared buffer cache') and enumerates the returned metrics, so the agent knows exactly what it gets. It does not explicitly contrast itself with the close sibling read_pg_buffercache_summary, which keeps it below a 5.

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?

It gives an important prerequisite ('Requires the pg_buffercache extension') and states the schema filter is optional, which helps decide whether the call will succeed. However, there is no explicit when-to-use guidance or pointer to alternatives such as read_pg_buffercache_summary when an aggregate view is wanted.

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