> ## 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.

# builtin__flatten

> Flattens a list of lists into one list, with no model call.

## Behavior

* `[[a, b], [c]]` becomes `[a, b, c]`.
* `depth` is how many levels are spliced; the default is 1.
* Elements that aren't lists are kept as they are.

## When to use it

* After a `map` whose items each return a list, such as one search per query, before deduping, sorting or ranking the results.

| Available to | Effect |
| - | - |
| Any agent or plan step | Read-only |

## Input

**depth** `integer`

Levels to flatten; default 1

**items** `any[]` *required*

The list, usually a template like \{\{E1.results}}

## Output

**items** `any[]` *required*

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


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