sql_query
Overviewâ
sql_query executes a read-only SQL query against the selected database.
It is the fastest way to inspect structured data before deeper analysis.
Parametersâ
{
"sql": "SELECT statement"
}
What it doesâ
- executes safe read-only SQL
- formats the result as markdown table output
- truncates large results to the first 50 rows
When to use itâ
- inspect schemas and sample rows
- answer business questions from structured data
- fetch data before Python analysis
Exampleâ
{
"sql": "SELECT product_category, SUM(revenue) AS total_revenue FROM sales GROUP BY product_category ORDER BY total_revenue DESC"
}
Notesâ
- only read operations are allowed
- statements like
INSERT,UPDATE,DELETE,DROP,ALTER, andCREATEare blocked - use it for retrieval, not mutation