create_collection
Creates a Directus collection as a real database table or grouping folder, optionally with initial fields, for organizing content or provisioning schema.
Instructions
Creates a collection, either a real database table or a grouping folder. A table gets an auto-increment integer id when no fields are passed; folder: true makes a grouping element, which has no schema and can hold neither items nor fields. Use create_field to add fields afterwards, apply_schema to provision several collections from a snapshot. The table is created immediately and is not rolled back when a later field in the same call fails. A fresh collection can take a moment to become readable: validate_collection_creation confirms it, refresh_collection_cache clears a stale cache. Returns the created collection.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"collection": "<collection>"
},
"name": "create_collection"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| meta | No | Collection metadata | |
| fields | No | Initial fields to create | |
| folder | No | Create a grouping folder instead of a table. A folder has no schema, so it cannot hold items and fields cannot be added to it. Default: false. | |
| collection | Yes | Collection name |