db_query
Run a pre-approved named query against an allow-listed PostgreSQL, MySQL, or Redis preset, returning rows as JSON. SQL is fixed at preset definition time, so arbitrary queries are blocked.
Instructions
Run a NAMED QUERY against a database preset (PostgreSQL, MySQL,
or Redis). You supply query_name (must match one declared in
the preset) and params (positional). The SQL / command is
FIXED at preset definition time — you cannot send arbitrary SQL.
Returns rows as JSON. Approval prompt fires per the preset's policy.
If the user previously approved a time-boxed window for this
preset+action, the call proceeds without a new prompt and is
recorded as 'windowed' in the audit log.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | No | Positional parameters; types must match the named query's `param_types`. | |
| query_name | Yes | Must match one of the preset's declared `queries[].name`. | |
| preset_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | ||
| rows_affected | Yes |