Skip to main content
Glama

Sizes

pg_sizes
Read-onlyIdempotent

Find what takes up PostgreSQL storage by listing databases, schemas, tables, indexes, and tablespaces by size, with heap, index, and TOAST sizes shown separately.

Instructions

Find what takes the space: the biggest databases, schemas, tables (with heap data, indexes and TOAST shown separately), indexes or tablespaces, largest first.

scope selects the kind of object. schema narrows tables and indexes to one schema. Partitions are listed as tables of their own. Sizes include all forks of each relation; use pg_bloat to see how much of a table is wasted.

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

Input Schema

NameRequiredDescriptionDefault
limitNo
scopeNotables
schemaNo
connectionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare read-only, idempotent and non-destructive. On top of that the description discloses non-obvious output behavior: heap data, indexes and TOAST are reported separately, partitions appear as their own tables, and sizes include all forks of each relation. These are real behavioral details rather than restatements, though nothing is said about connection handling or failure modes.

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?

Two tight paragraphs, front-loaded with the core purpose, then parameters, then one pointed cross-reference. No filler wording; each sentence carries information about behavior or routing.

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 read-only listing tool with no output schema, the description covers what is measured and how it is split (heap/index/TOAST, partitions, forks), which is the key ambiguity. Only the 'connection' parameter and the result shape (columns returned) are left implicit, which is a minor gap.

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?

Schema description coverage is 0%, so the description must carry parameter meaning. It explains 'scope' ('selects the kind of object') and 'schema' ('narrows tables and indexes to one schema'), which is genuine added meaning, and 'largest first' implies the role of 'limit'. Neither 'limit' nor 'connection' is addressed directly, so coverage stays partial.

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?

States a specific verb ('Find what takes the space') plus the exact resource set (databases, schemas, tables, indexes, tablespaces) and ordering ('largest first'). The closing sentence distinguishes it from pg_bloat, so an agent can route between the two without reading either schema.

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?

Explicitly names the alternative for a related question: 'use pg_bloat to see how much of a table is wasted.' It also explains how scope and schema steer the query. It lacks an explicit when-not-to-use statement or prerequisites for the scope values, so it falls short of a 5.

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