Agent tools

query_storage

query_storage({ storage?, action, … })

Read any connected database or bucket. Twelve actions, never asked — and the first one to call is overview, which answers in one turn what three would otherwise take.

category: readfree, except searchstart with overview
Using Python?

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

The actions

ActionOnTakes
overviewany—
collections · schema · find · count · aggregatea document databasecollection, and filters as JSON text
tables · sqla relational databasesql, params
objects · objecta bucketprefix, key
usagean IaGenify Cloud storagestorage, or nothing for the account
searchanyquery, limit — 1 credit

overview first

It is the difference between two turns and twenty

It returns everything the storage holds — collections or tables with their fields and one real example each, or a bucket's folders with what they weigh — in a single call. Discovering the shape one call at a time is a turn each.

Examples are masked

In those examples a value that looks like a secret or personal data — a password, a token, a hash, a key, an address, a phone number — is replaced by a marker followed by its type. The field is real, the value is not. The agent is told never to filter on a marker, and to read the field with find if the task truly needs it.

Filters travel as JSON text

query_storage({
  action: "aggregate",
  collection: "orders",
  pipeline: '[{"$match":{"status":"paid"}},{"$group":{"_id":"$model","total":{"$sum":"$amount"}}}]',
})
# The call the model makes:
query_storage = {
    "action": "aggregate",
    "collection": "orders",
    "pipeline": '[{"$match":{"status":"paid"}},{"$group":{"_id":"$model","total":{"$sum":"$amount"}}}]',
}

As a free-form object the keys beginning with $ are stripped, and a filter with no operator is a different query rather than a failed one. As text nothing is touched.

One aggregate, never a series of finds

For totals, averages and breakdowns the instruction is explicit: $match, then $group, then $sort. Paging through find to add numbers up costs a turn per page and gets them wrong.

Name the storage when there are several

storage takes the label as the system prompt lists it under « Connected storages ».