query_sql
Execute a read-only SQL query against the target connection. ONLY SELECT / WITH / EXPLAIN permitted. Write dialect-appropriate SQL for the connection's engine — use PostgreSQL syntax for postgres connections (SELECT NOW(), LIMIT, ILIKE), T-SQL for mssql (SELECT GETDATE(), TOP N, LIKE), MySQL for mysql (SELECT NOW(), LIMIT). Response meta includes connection + dialect so you know which syntax worked; reuse that dialect in follow-up calls. Default LIMIT 100 unless the user asks for all rows.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max rows to return (default 100, max 1000) | |
| query | Yes | SQL SELECT query to execute | |
| connection | No | Target connection name from this tenant's inventory. Call `list_connections` to see every name + dialect, then match semantically to the user's intent (e.g. 'analytics' → a connection named `*-analytics-*`; 'prod' → a connection with `prod-` prefix). If the user didn't specify, use the tenant's default (first added). Do not invent names — resolve from `list_connections` output. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | ||
| meta | No | ||
| display | No | ||
| summary | No | ||
| insights | No |