# run_select_query

> MCP tool executing a StackQL SELECT against a provider

Source: https://stackql.io/mcp/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`](/mcp/run_mutation_query) or [`run_lifecycle_operation`](/mcp/run_lifecycle_operation) for those.

Result rows are returned to the client but are deliberately excluded from the audit log.

See also:
[[ MCP overview ]](/command-line-usage/mcp) [[ `validate_select_query` ]](/mcp/validate_select_query) [[ `list_methods` ]](/mcp/list_methods) [[ SELECT language spec ]](/language-spec/select)

* * *

## 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.|

* * *

## 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.  A payload holding several statements is gated by its most privileged statement, so a mutation behind a leading `SELECT` is refused or needs approval exactly as it would through `run_mutation_query`.

* * *

## 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:
