SQL Tool
Run read-only SQL queries against the comms platform database. 1 tool in this category.
sql.run
Execute a read-only SQL query. Queries are validated and run against a read replica with a 30-second timeout. Write operations (INSERT, UPDATE, DELETE, DROP, etc.) are rejected.
Roles: ADMIN_ONLY
| Field | Type | Required | Description |
|---|---|---|---|
query | string | Yes | SQL query to execute |
params | any[] | No | Parameterized query values |
limit | integer | No | Max rows returned (default 100, max 1000) |
{
"tool": "sql.run",
"input": {
"query": "SELECT channel, COUNT(*) as count FROM comms.sends WHERE brand_id = $1 AND created_at > $2 GROUP BY channel",
"params": ["brand-uuid", "2026-05-01T00:00:00Z"],
"limit": 50
}
}Safety Constraints
- Read-only: Only SELECT queries are allowed
- Timeout: 30-second query timeout
- Row limit: Maximum 1,000 rows per query
- Audit logged: All queries are recorded in the audit trail
- No DDL: Schema modifications are blocked
- Parameterized: Always use
$1,$2, etc. for user-supplied values