run_select_query
Executes a SELECT statement against the configured providers and returns the result rows. Read only -- mutations and lifecycle operations are not accepted; use run_mutation_query or run_lifecycle_operation for those.
Result rows are returned to the client but are deliberately excluded from the audit log.
See also:
[ MCP overview ] [ validate_select_query ] [ list_methods ] [ SELECT language spec ]
Inputs
| Argument | Required | Description |
|---|---|---|
sql | Yes | A SELECT statement. Metadata statements (SHOW, DESCRIBE, DESC, EXPLAIN) are classed as read-only by the policy gate and accepted too; DESC is recognised in StackQL releases from v0.12.732. |
row_limit | No | Cap on the number of rows returned to the client. 0 (default) means no client-side cap. |
source | No | Query library entry ID when the SQL came from query_library_get. Attribution only; does not change execution or approvals. |
format | No | Text rendering: markdown or json. When omitted, uses the server's render setting. |
Output
| Renderer | Shape |
|---|---|
| Table | {rows: [...]} -- one object per row, keyed by column name |
Gating
Allowed in every server mode (read_only, safe, delete_safe, full_access) when every statement in the payload is read-only. From v1.0, INSERT, UPDATE, REPLACE, DELETE and EXEC are refused by this tool in every mode, including full_access, with an error naming run_mutation_query or run_lifecycle_operation. A payload holding several statements is classed by its most privileged statement, so a mutation behind a leading SELECT is refused in the same way. The tool declares destructiveHint: false and openWorldHint: true.
Example
Try this prompt with any elicitation-capable MCP client with the StackQL MCP server registered:
List the VPC networks in my Google Cloud project my-project
and tell me which ones use auto subnet creation.
Here's an example in Claude Desktop: