Return the current database name and its total disk size.
read-onlyany connectionsweeps instancesweeps group
databaseSize()
Return the current database name and its total disk size.
None of its own.
Also accepts connection, instance, group, described once under arguments every tool takes.
Size of the connected database. An absent extension or a missing grant is reported as {error, hint} instead.
| Field | Type |
|---|---|
| database | string | null |
| size | integer | null |
A physical replica is byte-identical here, so asking each member of a replication group adds nothing.
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "databaseSize",
"arguments": {
"connection": "shop_prod"
}
}
}
{
"database": "shop",
"size": 36120010752
}
Invented values on a fictional shop database, shaped by and checked against this tool's output schema. Real output is returned as structuredContent to clients that negotiate MCP 2025-06-18 or later.
diskUsage, serverSettings, currentActivity, currentLocks, databaseStats, statementStats, wraparoundStatus, progressStats, ioStats, checkpointStats, tableIOStats, hostCapacity, bufferCacheSummary, bufferCacheContents