create_collection
Define a new collection in PocketBase by specifying its name, type, fields, and access rules, enabling structured data storage and management via MCP Server.
Instructions
Create a new collection in PocketBase note never use created and updated because these are already created
Input Schema
Name | Required | Description | Default |
---|---|---|---|
createRule | No | API rule for creating records | |
deleteRule | No | API rule for deleting records | |
fields | Yes | List with the collection fields | |
listRule | No | API rule for listing and viewing records | |
name | Yes | Unique collection name (used as a table name for the records table) | |
passwordAuth | No | Password authentication options | |
type | No | Type of the collection | base |
updateRule | No | API rule for updating records | |
viewQuery | No | SQL query for view collections | |
viewRule | No | API rule for viewing a single record |
Input Schema (JSON Schema)
{
"properties": {
"createRule": {
"description": "API rule for creating records",
"type": "string"
},
"deleteRule": {
"description": "API rule for deleting records",
"type": "string"
},
"fields": {
"description": "List with the collection fields",
"items": {
"properties": {
"collectionId": {
"description": "Collection ID for relation type fields",
"type": "string"
},
"name": {
"description": "Field name",
"type": "string"
},
"required": {
"description": "Is field required?",
"type": "boolean"
},
"type": {
"description": "Field type",
"enum": [
"bool",
"date",
"number",
"text",
"email",
"url",
"editor",
"autodate",
"select",
"file",
"relation",
"json"
],
"type": "string"
},
"values": {
"description": "Allowed values for select type fields",
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"type": "array"
},
"listRule": {
"description": "API rule for listing and viewing records",
"type": "string"
},
"name": {
"description": "Unique collection name (used as a table name for the records table)",
"type": "string"
},
"passwordAuth": {
"description": "Password authentication options",
"properties": {
"enabled": {
"description": "Is password authentication enabled?",
"type": "boolean"
},
"identityFields": {
"description": "Fields used for identity in password authentication",
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"type": {
"default": "base",
"description": "Type of the collection",
"enum": [
"base",
"view",
"auth"
],
"type": "string"
},
"updateRule": {
"description": "API rule for updating records",
"type": "string"
},
"viewQuery": {
"description": "SQL query for view collections",
"type": "string"
},
"viewRule": {
"description": "API rule for viewing a single record",
"type": "string"
}
},
"required": [
"name",
"fields"
],
"type": "object"
}