query_cube
Retrieve data from a Saudi economy data cube by specifying drilldowns and measures. Filter by member ID, set language, and paginate results.
Instructions
Query a cube by drilldowns (level names) + measures; returns a compact, paginated result with the resolved query echoed back.
cut filters by member: a {level: member_id} mapping, e.g. {"Province": "1"} to
keep only that province. Use the member ID (from describe_cube(cube, level=...)),
NOT its caption. locale ('en' or 'ar') sets the language of member captions in
the result rows (e.g. 'الرياض' vs 'Al-Riyadh'); member IDs and numbers are unaffected.
Validates level/measure names AND cut level names locally and fails loud with the
valid options.
limit: max rows per call (default 100), HARD-CAPPED at 5000. A larger value is
silently reduced to 5000 - the tool will NOT return an unbounded result, because a
single result over ~1MB is rejected outright by the client (no partial data comes
back). THERE IS NO 'get everything in one call'. To get more than one page, do NOT
raise limit: page with offset (the note gives you the next offset; repeat until
complete), OR narrow with a cut / fewer drilldowns. Paging or narrowing is the
intended path and is faster than one giant call that errors.
offset: start row of this page (default 0). When combining pages, only sum additive
measures (counts/sums); never average an index or ratio across pages.
Note: a cut on a valid level but nonexistent member returns 0 rows (reported as 'valid query, no matching data'), not an error - check the member id if you expected rows.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cut | No | ||
| cube | Yes | ||
| limit | No | ||
| locale | No | en | |
| offset | No | ||
| measures | Yes | ||
| drilldowns | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||