SQLTools connects an agent to a database. Point it at a read-only connection and the agent can introspect the schema and run queries.
db and the SQLTools connection are separate. db stores the agent’s sessions. SQLTools points at the warehouse you are answering questions about. Keep them distinct.
Introspect before generating
A data agent that guesses column names is wrong confidently.SQLTools ships list_tables and describe_table so the agent grounds SQL in the real schema. The instruction to introspect first is what makes it reliable.
run_sql_query(query, limit=10) returns at most 10 rows unless the agent passes a different limit. Pass limit=None for the full result set. Otherwise a GROUP BY over more than 10 groups comes back truncated with no sign that rows were dropped, so tell the agent when an answer needs every row.
Scope the connection
SQLTools executes any SQL the engine permits. It does not classify statements as read-only. This engine starts transactions with default_transaction_read_only=on, which blocks ordinary write statements. Because that setting is a configurable session default, use a non-owner database role with no write grants as the hard boundary. See Safe data access for the full read and write split.