Skip to main content
Glama
isdaniel

PostgreSQL-Performance-Tuner-Mcp

get_table_stats

Read-onlyIdempotent

Analyze PostgreSQL table statistics to identify maintenance needs and performance issues. Provides table sizes, row counts, scan ratios, and vacuum timing data for user-created tables.

Instructions

Get detailed statistics for user/client database tables.

Note: This tool analyzes only user-created tables and excludes PostgreSQL system tables (pg_catalog, information_schema, pg_toast). This focuses the analysis on your application's custom tables.

Returns information about:

  • Table size (data, indexes, total)

  • Row counts and dead tuple ratio

  • Last vacuum and analyze times

  • Sequential vs index scan ratios

  • Cache hit ratios

This helps identify tables that may need maintenance (VACUUM, ANALYZE) or have performance issues.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
schema_nameNoSchema to analyze (default: public)public
table_nameNoSpecific table to analyze (optional, analyzes all tables if not provided)
include_indexesNoInclude index statistics
order_byNoOrder results by this metricsize
Behavior4/5

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

The description adds valuable behavioral context beyond what annotations provide. While annotations already indicate it's read-only, non-destructive, and idempotent, the description adds important details: it analyzes only user-created tables (excluding system tables), focuses on application custom tables, and explains what kind of maintenance issues it helps identify. No contradiction with annotations exists.

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?

The description is well-structured and appropriately sized. It starts with the core purpose, provides important exclusion notes, lists what information is returned, and ends with the practical value. Every sentence adds meaningful information with zero waste.

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 analysis tool with good annotations and comprehensive input schema, the description provides excellent context about scope (user tables only), output content (specific statistics listed), and practical application (identifying maintenance needs). The main gap is the lack of output schema, but the description compensates by detailing what information is returned.

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 description coverage, the input schema already documents all parameters thoroughly. The description doesn't add significant parameter-specific information beyond what's in the schema, though it does provide context about what tables are analyzed (user-created vs system tables) which relates to the schema_name parameter's usage.

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 clearly states the tool's purpose: 'Get detailed statistics for user/client database tables' with specific details about what statistics are returned (table size, row counts, scan ratios, etc.). It distinguishes from sibling tools by focusing on table statistics rather than index analysis, query analysis, or other database health checks.

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 provides clear context for when to use this tool: 'This helps identify tables that may need maintenance (VACUUM, ANALYZE) or have performance issues.' It also notes what tables are excluded (system tables). However, it doesn't explicitly state when NOT to use it or name specific alternatives among the sibling tools.

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/isdaniel/pgtuner-mcp'

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