Define collection schema
define_collection_schemaDefine (or clear, with schema=null) a JSON Schema on a collection in a site's data store. A schema validates every appended record server-side, turning the collection into a typed backend. Defining a schema requires Pro. Scoped to a site you can edit.
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": {
"site_id": "<site_id>",
"collection": "<collection>",
"schema": "<schema>"
},
"name": "define_collection_schema"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| schema | Yes | A JSON Schema object to enforce, or null to make the collection schemaless | |
| site_id | Yes | The site that owns the collection | |
| collection | Yes | The collection name | |
| workspace_id | No | Optional: the workspace to act in, from list_workspaces (the connection reaches the person's personal space and every workspace they are a member of). Required on a write when the connection reaches more than one workspace. Omit to act in the personal space (for an older single-workspace connection, the one workspace it was authorized for). |