Create Item

Create a new item in a Directus collection Arguments: <collection> <field=value> [field=value...].

agents-store Updated 0 repo stars

File contents

Create Item

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
  • field=value pairs — Field values for the new item

Process

  1. Parse collection name and field=value pairs from input
  2. Call schema tool with keys: ["<collection>"] to check required fields
  3. Warn if any required fields are missing from the input
  4. Build data object from field=value pairs
  5. Call items tool with:
    {
      "action": "create",
      "collection": "<collection>",
      "data": [{ "field1": "value1", "field2": "value2" }]
    }
    
    Remember: data is ALWAYS an array
  6. Display the created item with its ID
  7. Suggest viewing the item or creating more

Example

Input: posts title="My New Post" status=draft content="Post content here"

{
  "action": "create",
  "collection": "posts",
  "data": [{
    "title": "My New Post",
    "status": "draft",
    "content": "Post content here"
  }]
}

Agents-Store/codex-plugins commit f19f3c05c5

Frequently asked questions

npx get-skill add agents-store/create-item