Skip to main content
Glama

Check the connection and its privileges

db_health
Read-onlyIdempotent

Check whether a database is reachable, its version, authenticated role, read-only status, object counts, and pool state to diagnose failed connections or writes.

Instructions

Ask the database about itself: reachable or not, server version, the role this server authenticated as, whether that role or the server is read-only, object counts, and this server's pool and cache state. Use it instead of guessing at why a connection or a write failed. Note what "readOnly": false does and does not do: it is a request to THIS server, not a security boundary. The boundary is the database role -- a role holding INSERT will succeed whatever these flags say, and a role without them will fail however many are set.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uriNoConnection string, for example postgres://user@host/db, mysql://user@host/db, sqlite:///path/to/app.db, mongodb://host/db or redis://host. Pass "profile" wherever db_list shows one.
profileNoA profile name from db_list. Exactly one of "profile" (a name from db_list) or "uri" (an ad-hoc connection string). Prefer "profile": it keeps the password out of the transcript.
timeoutNoMilliseconds before giving up on the diagnostics (default 30000, between 1 and 86400000).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYesFalse when the call failed; read "error" then.
poolNoThis server's connection cache.
roleNoThe database user this server authenticated as.
errorNoPresent only when "ok" is false.
checksYesOne {name, ok, detail} per diagnostic. A failed one is a finding, not an error.
driversNoWhich native drivers are installed and loadable.
objectsNoObject counts by kind, for example {"tables":12}.
databaseYesDriver that answered.
profilesNo
reachableYesFalse when no connection could be made at all.
readOnlyRoleNoWhether the role and the server together look read-only, from a read-only probe. Null when the driver cannot answer that.
serverVersionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.0.4

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, but the description goes well beyond them by clarifying that 'readOnly: false' is a request to this server and not a security boundary, and that the enforcing boundary is the database role's grants. That is exactly the kind of semantics an agent needs to avoid misreading a diagnostic result.

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 content is front-loaded: the enumeration of what is reported comes first, then the when-to-use clause, then the readOnly caveat. It is longer than average but every sentence carries information; the closing caveat is slightly tangential to invoking the tool but still earns its place.

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?

With an output schema present, the description need not explain return shapes, yet it still summarizes what comes back, and it covers the failure-diagnosis use case and the readOnly interpretation pitfall. Nothing an agent needs to call this correctly is missing.

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 100%, so uri/profile/timeout are already fully documented in the schema, including the profile-preferring guidance. The description adds no additional parameter meaning, so the baseline 3 applies.

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 gives a concrete verb and resource ('ask the database about itself') and then enumerates exactly what it reports: reachability, server version, authenticated role, read-only flags, object counts, pool/cache state. That enumeration distinguishes it sharply from db_query, db_schema, and db_explain without needing to name them.

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?

It states a clear triggering condition — 'Use it instead of guessing at why a connection or a write failed' — which is genuinely actionable for an agent diagnosing failures. It stops short of naming the sibling alternatives or stating when-not to reach for it (e.g. routine inspection vs. failure triage).

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