> For the complete documentation index, see [llms.txt](https://docs.testvibe.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.testvibe.com/testvibe-api/api-reference/runs/wait_for_run.md).

# wait\_for\_run

Block until the run finishes, polling every 3 seconds, and return its [results digest](/testvibe-api/api-reference/runs/get_run.md).

{% hint style="info" %}
This is an **MCP / CLI convenience** — there is no REST `wait` endpoint. Over raw HTTP, poll [`GET …/runs/{runId}`](/testvibe-api/api-reference/runs/get_run.md) yourself. See [Long-running operations](/testvibe-api/api-reference/async-operations.md).
{% endhint %}

## Arguments

| Argument         | Type    | Required | Description                                                                       |
| ---------------- | ------- | -------- | --------------------------------------------------------------------------------- |
| `runId`          | integer | yes      | The run id from [`run_feature`](/testvibe-api/api-reference/runs/run_feature.md). |
| `timeoutSeconds` | integer | no       | How long to wait (default **120**, max **170**).                                  |
| `project`        | string  | no       | Project public id (defaults to the configured project).                           |

{% tabs %}
{% tab title="MCP" %}
Tool **`wait_for_run`** — `{ "runId": 214 }`.
{% endtab %}

{% tab title="CLI" %}

```bash
testvibe run "Login Functionality" --wait
```

{% endtab %}
{% endtabs %}

## Result

The same payload as [`get_run`](/testvibe-api/api-reference/runs/get_run.md), taken when `status` left `running` — or at the timeout.

{% hint style="warning" %}
**Timing out cancels nothing.** If the digest still says `"status": "running"`, call the tool again with the same `runId`.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.testvibe.com/testvibe-api/api-reference/runs/wait_for_run.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
