largeObjects

Return how many large objects this database holds and who owns them (pg_largeobject_metadata).

read-onlyany connectionsweeps instancesweeps group

Synopsis

largeObjects()

Description

Return how many large objects this database holds and who owns them (pg_largeobject_metadata). Large objects live in a catalog rather than in any user relation, so tableSize, listTableSizes and tableStats are all blind to them while diskUsage.databases counts their bytes -- the signature is "the database grew and no table did", which triage-disk-space could not otherwise resolve: it ranks tables, finds nothing, and stops.

NO SIZES: the bytes are in pg_largeobject, which is not publicly readable and which the documentation directs callers away from, so a size sum is not reliably available here and is not invented. An unreferenced large object cannot be identified from the catalog alone either -- it is unreferenced only if no column holds its oid -- and lo_unlink on a live oid loses data, so confirm against the application before deleting.

Parameters

None of its own.

Also accepts connection, instance, group, described once under arguments every tool takes.

Output

Large objects, which no size tool can see. An absent extension or a missing grant is reported as {error, hint} instead.

FieldType
by_ownerobject | null
notestring | null
totalinteger | null

Scope

A physical replica is byte-identical here, so asking each member of a replication group adds nothing.

Example mocked data

Request

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "largeObjects",
    "arguments": {}
  }
}

Result

{
  "total": 1284,
  "by_owner": {
    "app_rw": 1280,
    "migrator": 4
  },
  "note": "Sizes are not reported: the bytes live in pg_largeobject, which is not publicly readable."
}

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.

See also

listSchemas, listTables, tableDetails, tableStats, listPartitions, partitionDetails, listTableStats, tableSize, listTableSizes, listFunctions, functionDetails, listEnums, enumDetails, listTypes, typeDetails, columnHistogram, listExtendedStatistics, listSequences