Skip to main content
Glama

database_health

Monitor active connections, sessions, locks, and transactions in real time to diagnose database health issues like connection problems, lock contention, and slow performance.

Instructions

Live database health - monitors active connections, sessions, locks, transactions.

LEVEL: Database (single database monitoring)

USE FOR: "is database healthy?", connection issues, lock problems, blocked queries, idle transactions, deadlock detection, XID wraparound check, "why is DB slow right now?". DO NOT USE FOR: index analysis (use maintenance_analysis), slow query history (use query_performance), table sizes/stats (use maintenance_analysis), query optimization (use query_optimizer), PostgreSQL server config (use configuration_review), replication (use replication_status). REAL-TIME: Shows current state of database activity.

ERROR RECOVERY:

  • "not connected": Call connect() first or pass url parameter

  • "permission denied on pg_stat_*": User needs pg_monitor role or superuser

  • Use summary_only=True for large/busy databases to reduce payload size

INCLUDE OPTIONS:

  • 'all': Everything (default)

  • 'summary': Database stats, connections by state, checkpoint stats

  • 'sessions': Session summary, by app/user/host, idle in transaction, active sessions

  • 'locks': Lock summary, waiting locks, blocking tree, table lock hotspots, deadlocks

  • 'transactions': XID wraparound status, transaction stats, long-running transactions

  • 'queries': Active queries, long-running queries, wait events

  • 'bloat': Tables needing vacuum

Examples: database_health() - Full health report database_health(include='locks') - Only lock information database_health(include='sessions') - Only session information database_health(include='transactions') - XID status and long transactions database_health(format='markdown') - Human-readable output

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
includeNoWhat to include: 'all', 'summary', 'sessions', 'locks', 'transactions', 'queries', 'bloat'all
urlNoDatabase URL for auto-connection
formatNoOutput format: 'json' or 'markdown'json
summary_onlyNoReturn only summary counts and critical issues, not detailed lists

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It mentions real-time state, error recovery, and the summary_only option. It does not explicitly state if it is read-only, but the context implies monitoring. Overall, it discloses key behavioral traits.

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?

The description is long but well-structured with clear sections (LEVEL, USE FOR, DO NOT USE FOR, REAL-TIME, ERROR RECOVERY, INCLUDE OPTIONS, Examples). It is front-loaded with purpose and organized for easy scanning, though slightly verbose.

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 complexity (4 parameters, output schema exists), the description is thorough. It covers use cases, alternatives, error scenarios, and options comprehensively. With an output schema present, it does not need to describe return values.

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 100% with all 4 parameters described. The description adds value beyond the schema by providing detailed explanations of include options, examples, and usage scenarios for each parameter.

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 it monitors live database health, listing specific metrics such as active connections, sessions, locks, and transactions. It distinguishes from sibling tools by explicitly stating what NOT to use it for, e.g., index analysis or slow query history.

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

Usage Guidelines5/5

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

The description provides explicit 'USE FOR' and 'DO NOT USE FOR' sections with concrete scenarios like connection issues, lock problems, blocked queries, etc. It also includes error recovery steps and options like summary_only for large databases.

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/snss10/DBeast'

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