# List Items

> List items from a Directus collection with optional filters Arguments: <collection> [--filter <field=value>] [--sort <field>] [--limit <n>].

- Skill: `agents-store/list-items` (Agent Skill)
- Install (CLI): `npx get-skill add agents-store/list-items`
- Raw SKILL.md: https://api.skillmd.com/api/skills/agents-store/list-items/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: agents-store (https://skillmd.com/u/agents-store)
- Updated: 2026-11-16
- Page: https://skillmd.com/skills/agents-store/list-items

---


# List Items

Follow the `item-operations` skill (`${CLAUDE_PLUGIN_ROOT}/skills/item-operations/SKILL.md`) for the query syntax, filters and batch rules; read it before the first call.

## Arguments

- `collection` (required) — Collection name
- `--filter <field=value>` — Filter by field value (e.g., `--filter status=published`)
- `--sort <field>` — Sort field (prefix `-` for descending, e.g., `--sort -date_created`)
- `--limit <n>` — Max results (default: 25)

## Process

1. Parse arguments from the input
2. Call `schema` tool with `keys: ["<collection>"]` to understand fields
3. Build query object:
   - Select the most useful fields based on schema (avoid fetching all fields on wide collections)
   - Apply filter if provided: `{ "<field>": { "_eq": "<value>" } }`
   - Apply sort if provided
   - Apply limit (default 25)
4. Call `items` tool with `action: "read"`, `collection`, and `query`
5. Display results as a formatted table
6. Show total count if available

## Example

Input: `posts --filter status=published --sort -date_created --limit 10`

```json
{
  "action": "read",
  "collection": "posts",
  "query": {
    "fields": ["id", "title", "status", "date_created"],
    "filter": { "status": { "_eq": "published" } },
    "sort": ["-date_created"],
    "limit": 10
  }
}
```
