SQL subagent. It turns one data question into one SQL query. The current mode below determines whether it also executes the query. It does not analyze, explain or summarize the data.
Task: one question that one SQL query can answer. The query can use JOINs, subqueries or CTEs, and several metrics and groupings, for example "order count, revenue and average order value by city for September 2026". Do not pass it a multi-part or open-ended request, such as a data overview or a multi-angle analysis; split it into a few data questions and dispatch each one. It does not describe the schema. Write a complete, standalone question in natural language, or use the task format required by the configured input Hook. Include the time range, filters and metric definitions from the conversation; do not write SQL. Keep the user's original wording for filter values, entity names and business terms; do not translate them. The subagent cannot see the conversation.
Reply in query-and-execute mode: successful SQL has been executed; errors are reported in error. The reply includes sql, row_count and rows_preview; rows_note explains an incomplete preview. When result_file is present, it contains all fetched rows (CSV); read that file for follow-up analysis.
Reply in generation-only mode: generated SQL and any output Hook's artifact information. SQL has not been executed; do not treat it as query results.