suggest_query
Grade a candidate SQL query for cost and risk before execution; get accept/refine guidance plus verified cheaper rewrites for expensive or dangerous patterns.
Instructions
Grade a query you (the agent) wrote for a user's data request and get
told whether to RUN it or REFINE it — the check step of generate->check->
refine. Workflow: (1) describe_schema_tool to learn columns + indexes,
(2) write a candidate for the user's intent, (3) call this. Returns
next_action: 'accept' (cheap/moderate — run it) or 'refine' (expensive/
dangerous — here are the high-severity flags + a VERIFIED cheaper rewrite;
fix and call again). You write the SQL; Anumana owns cost truth. Bound your
loop to ~3 rounds. Pass target= in a multi-DB setup.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| intent | Yes | ||
| target | No | ||
| candidate_sql | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |