Skip to main content
Glama
devopam

MCPg - Production-grade PostgreSQL MCP Server

Audit sequences

audit_sequences
Read-only

Checks sequences for nearing ceiling values to prevent catastrophic overflow. Flags serial, identity, or explicit sequences when last_value exceeds warning or critical thresholds.

Instructions

Flag sequences nearing their ceiling — serial / identity / explicit sequences whose last_value / max_value exceeds warning_pct (default 80) or critical_pct (default 95). Sequence overflow is catastrophic and silent until the next nextval() raises 'reached maximum value' — the int4 serial ceiling (2^31-1) is hit far more often than expected. Pure read; available=false on PG < 10 (no pg_sequences). Returns an object with available, total_examined, warning_pct, critical_pct, detail, and sequences (at-risk only, sorted by used_pct desc — each with schema, sequence, last_value, max_value, used_pct, remaining, status).

Example: audit_sequences(warning_pct=80, critical_pct=95)

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.
warning_pctNo
critical_pctNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
detailNo
availableYes
sequencesYes
warning_pctYes
critical_pctYes
total_examinedYes
Behavior5/5

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

Consistent with annotations (readOnlyHint=true), the description explicitly states 'Pure read'. It adds valuable context about PG<10 availability and the catastrophic nature of overflow, providing behavioral details beyond annotations.

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 concise yet comprehensive, covering purpose, importance, read-only nature, PG version caveat, and return structure in a few efficient sentences. Every sentence adds value, and the example at the end aids understanding.

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 purpose and complexity, the description is highly complete. It explains the return object fields in detail, handles the PG<10 edge case, and is sufficient for an agent to understand and invoke the tool correctly without needing the output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is low (33%), but the description adds meaning by defining the purpose of warning_pct and critical_pct with defaults and giving an example call. This compensates for the schema's lack of descriptions for those parameters.

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 flags sequences nearing their ceiling, specifying serial/identity/explicit sequences and the warning/critical thresholds. This distinguishes it from sibling tools like list_sequences which list all sequences without risk analysis.

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 implies usage for proactive overflow monitoring and notes that overflow is catastrophic and silent. However, it does not explicitly contrast with alternatives like list_sequences or when not to use it, slightly limiting guidance.

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