run · read

overview

storage.run({ action: "overview" })

What is in this storage, in one call. Written to replace the three or four you would otherwise make to find out.

any storagefreeone round trip
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

The point is the turn count, not the convenience. Orienting yourself the long way is collections, then a find per collection to see the shape — several calls, and on an agent several billed turns. This answers it once.

What comes back, per kind

StorageYou get
Document databaseEvery collection, its count, and a sample document.
Relational databaseUp to 30 tables, their columns, and one example row each.
Object storageThe top-level prefixes, with how many objects and how many bytes.
const map = await storage.run({ action: "overview" });

// Relational: { tables: [{ name, columns, sample }], truncated }
// Document:   collections with counts and a sample
// Objects:    prefixes with counts and sizes
overview = storage.run(action="overview")

# Relational: {"tables": [{"name", "columns", "sample"}], "truncated"}
# Document:   collections with counts and a sample
# Objects:    prefixes with counts and sizes

A relational overview has no row counts, on purpose

A COUNT is charged by the row on some providers

Counting every table to tell you how big it is can cost more than the query you were about to write. One example row per table is enough to write the right statement, and it costs one row.

truncated

Thirty tables at most. truncated says how many were left out — a non-zero value means ask for tables if you need the rest.

Where it belongs

At the start of anything that must work against a storage it has not seen: an agent given a database, a migration script, a dashboard that adapts to what is there.