# run_lifecycle_operation

> MCP tool executing a StackQL EXEC lifecycle operation

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

Executes a StackQL `EXEC` lifecycle operation -- the non-CRUD provider actions (start/stop a VM, rotate a key, trigger a workflow, etc.).  **Real side effects.**

Gated by the server [mode](/command-line-usage/mcp#server-modes):

| Mode | Lifecycle `EXEC` |
|--|--|
|`read_only`|refused|
|`safe` (default)|needs approval (elicitation)|
|`delete_safe`|needs approval|
|`full_access`|allowed|

:::info

A payload holding several statements is gated by its most privileged statement

:::

When approval is needed and the client did not advertise elicitation, the call is refused.

See also:
[[ MCP overview ]](/command-line-usage/mcp) [[ `run_mutation_query` ]](/mcp/run_mutation_query) [[ `describe_method` ]](/mcp/describe_method) [[ EXEC language spec ]](/language-spec/exec)

* * *

## Inputs

| Argument | Required | Description |
|--|--|--|
|`sql`|Yes|A StackQL `EXEC` statement targeting a lifecycle method.|

* * *

## Output

| Renderer | Shape |
|--|--|
| KV | `{messages: [...], timestamp}` |

* * *

## Example

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

```
The Compute instance web-01 in us-central1-a  
(project my-project) is stuck.  Please stop it.
```

The MCP client will surface an approval prompt before the operation is dispatched, unless the server is running in `full_access` mode.

Here's an example in Claude Desktop:
