athena_run_query
Run a single SQL query on an Athena workspace, polling until completion or timeout, then return execution ID, status, and first 1000 rows. Structured error codes identify read-only or multi-statement violations.
Instructions
Run a SQL query against an Athena workspace; polls until SUCCEEDED /
FAILED / CANCELLED or max_wait_seconds elapses, then returns the
execution id, status, and the first 1000-row page on success.
Read-only / multi-statement / UNLOAD violations come back as 400 with a
structured code (READ_ONLY_VIOLATION, MULTI_STATEMENT, etc).
BYTES_CAP_EXCEEDED is the same path — the platform auto-cancels the
execution and surfaces the code on the next poll.
Args: workspace_id: The Athena workspace id. sql: A single SQL statement (the parser gate rejects multi-statement). max_wait_seconds: How long to poll before timing out (caller can resume with athena_get_execution_status). Default 60.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| workspace_id | Yes | ||
| max_wait_seconds | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |