> ## Documentation Index
> Fetch the complete documentation index at: https://graph.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# filter

> Splits a list into the items that pass a per-item condition and the items that don't.

## How it works

* `over` must produce a list. The gate runs once per item, with `{{item}}` and `{{index}}` available.
* Gate it with exactly one of `where`, `infer` or `decide`. See [Conditions and bodies](/plans/reference/conditions-and-bodies).
* With `decide`, the result also includes each item's `probabilities`.

## When to use it

* Narrow a list before `map`, so later steps only see items they can handle.
* Prefer `where` when a field comparison decides. `infer` and `decide` make one model call per item; set `concurrency` to run them in parallel.

## Input

**concurrency** `integer`

Maximum `infer` verdicts in flight; 1 (default) evaluates one at a time.

**decide** `object`

A per-item yes/no question answered by a decision model (only when one is configured); keeps the element when its probability reaches min\_confidence. Results add `probabilities`, aligned with `over`.

**decide.criteria** `object`

**decide.criteria.false** `string`

**decide.criteria.true** `string`

**decide.min\_confidence** `number`

0 to 1; default 0.5

**decide.model** `string`

A decision model role; defaults to decider

**decide.question** `string` *required*

**decide.state** `any`

The data to judge, usually \{\{item}}

**infer** `string`

A yes/no question about \{\{item}}; the element is kept on yes. One judge call per item.

**model** `string`

Model role for `infer` verdicts (any configured role, standard or custom); defaults to the judge role.

**over** `any` *required*

The list to partition — usually a template like \{\{E0.issues}} that resolves to an array.

**where** `object`

**where.op** `enum\<string\>` *required*

Available options: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `empty`, `not_empty`, `contains`

**where.to** `any`

Comparison operand (omit for empty/not\_empty)

**where.value** `any` *required*

Usually a template about the current element, like \{\{item.status}}

## Result

Later steps read these as `{{<step id>.<field>}}`.

**count** `integer`

How many items passed.

**dropped** `object[]`

The items that didn't pass.

**dropped\_count** `integer`

How many items didn't pass.

**items** `object[]`

The items that passed, in their original order.

**probabilities** `number[]`

With `decide`: each item's probability, in list order.

```yaml Plan step theme={null}
- id: E1
  tool_name: filter
  input:
    over: "{{input.over}}"
```

```json Result theme={null}
{
  "count": 2,
  "dropped": [
    {
      "…": "…"
    }
  ],
  "dropped_count": 1,
  "items": [
    {
      "…": "…"
    },
    {
      "…": "…"
    }
  ],
  "probabilities": [
    0.91,
    0.12,
    0.77
  ]
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.