answer
Generates and executes caller-scoped SQL from a plain-language question, selecting relevant schema with the server's configured model and returning rows.
Instructions
Question in, rows out: selects the schema, writes the SQL with the server's own configured model, and runs it, all scoped to the caller. Only available when the server has a model configured; most clients should use select_schema then run_query with their own model instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| roles | No | The caller's roles or groups, e.g. ['finance', 'payroll']. Objects and columns restricted to a role are visible only when it is listed here. Omitted = no roles. | |
| top_k | No | How many tables and views to select for the question (default 6). Raise it for questions that span many areas; the caller's visible objects are the upper bound. | |
| max_rows | No | Most rows to return (default 50, at most 200). The result says when it was truncated. | |
| question | Yes | The user's question in plain language, e.g. 'revenue by month' or 'which customers owe us money'. | |
| principal | No | Who is asking, as an identity string such as 'okta:jdoe'. Pass it whenever you know the user: visibility is decided for this identity. Omitted = anonymous, which sees only unrestricted objects. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |