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

> Keeps the first n items of a list, with no model call.

## Behavior

* Returns the first `n` items; a shorter list is returned whole.

## When to use it

* The top-k cut after [`builtin__sort`](https://graph.mintlify.site/tools/reference/builtin/sort). [`builtin__rank`](https://graph.mintlify.site/tools/reference/builtin/rank) cuts its own result with `top_k`.

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

## Input

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

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

**n** `integer` *required*

How many items to keep

## Output

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

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


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