Generate Sql
Generate SQL from natural language, with optional execution.
Supports SELECT, DML, and DDL generation. Agent callers are subject to guardrail levels that restrict which statement types are allowed. If execute=true, runs the generated SQL and returns results.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”object
UUID of the registered database connection.
Natural language description of the SQL to generate.
If true, execute the generated SQL after generation.
Who is generating: ‘human’ (no guardrails) or ‘agent’ (guardrails apply).
Agent guardrail level. Only applies when caller=‘agent’.
Responses
Section titled “ Responses ”Successful Response
object
object
The generated SQL statement.
Explanation of what the SQL does.
Type of SQL: select, dml, or ddl.
Whether the SQL was executed.
object
Column names from the result set.
Result rows as arrays of values.
Number of rows returned.
True if results were capped by row_limit.
object
Error code (e.g., GUARDRAIL_VIOLATION, SQL_ERROR, TIMEOUT).
Human-readable error message.
Validation Error