# list_flaky_cases

`tools/call` · `POST /clanker/v1/test-runs:flaky-cases`

List a product's flaky cases by lane, an environment and a coverage level: for each, its latest 20 finished CI runs unless you ask for more or fewer, how many passed every first attempt, and each case that failed its first attempt in them, with how often, the failures' kinds, the latest one's run and the case's ticket. CI runs are those an account API key published against a site not on the machine running it; runs of quarantined cases only are left out. Needs read access.

- Area: Test runs
- Needs the read grant. Read-only. Idempotent.

## Inputs

- `product` (string, required): The product to report on, by slug, such as storefront.
- `environment` (string): Only this environment's lanes, by slug, such as production.
- `coverage` (string, one of: `critical`, `acceptance`, `regression`, `exhaustive`): Only lanes that ran this coverage level.
- `runs` (integer): How many of each lane's latest CI runs to count; 20 unless given. From 1 to 200.

## Request

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "list_flaky_cases",
    "arguments": {
      "product": "storefront",
      "environment": "production"
    }
  }
}
```

## HTTP request

The same call over the clanker HTTP API, with a clanker OAuth access token:

```bash
curl -X POST https://api.clankership.com/clanker/v1/test-runs:flaky-cases \
  -H "Authorization: Bearer $CLANKER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "product": "storefront",
    "environment": "production"
  }'
```
