# validate_select_query

> MCP tool parsing and planning a StackQL SELECT without executing it

Source: https://stackql.io/mcp/validate_select_query

Parses and plans a single `SELECT` statement without executing it.  Returns `{valid, errors}`.  Useful when an agent wants to verify its query compiles and binds against the discovered method before committing to a real API call.

:::info

`SELECT` only, and exactly one statement, a payload holding more than one statement is refused with `validate_select_query accepts exactly one statement`.

:::

See also:
[[ MCP overview ]](/command-line-usage/mcp) [[ `list_methods` ]](/mcp/list_methods) [[ `run_select_query` ]](/mcp/run_select_query)

* * *

## Inputs

| Argument | Required | Description |
|--|--|--|
|`sql`|Yes|A single `SELECT` statement.|

* * *

## Output

| Renderer | Shape |
|--|--|
| KV | `valid` (bool) and `errors` (array of strings, empty when valid) |

* * *

## Gating

Allowed in every server mode.  No API calls are made.

* * *

## Example

Try this prompt with any elicitation-capable MCP client with the StackQL MCP server registered:

```
Can you validate this query before I run it:

select name, network  
from google.compute.subnetworks  
where project = 'my-project' and region = 'us-central1';
```

Here's an example in Claude Desktop:
