put_collection_schema
Replace the whole field schema (draft; publish makes it live). Edit what get_collection_schema returns; keys as list_collections gives them ("blog/" or an id). Field: { key, type, label?, help?, required?, unique?, inCard?, default? } — type text (multiline, minLength, maxLength) | number (min, max, integer) | boolean | option (options[] required) | multiOption (options[] required, max) | link | email | phone | color. Keys: letter then letters/digits/_ (≤40), not a built-in post field (author: text, or a reference to authors/ with the Authors feature), not secret-looking. ≤60 fields per collection. settings.defaultSort: date:desc|date:asc|title:asc|slug:asc. Removing a collection's entry drops its definitions (post values stay). Values go in put_post meta.custom (fieldWarnings are soft). 400 invalid_collection_schema lists issues; 409 conflict = stale ifMatch.
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": "<site>",
"schema": "<schema>"
},
"name": "put_collection_schema"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site | Yes | Site slug, e.g. acme-studio | |
| schema | Yes | Whole schema file: { "v": 1, "collections": { "<key>": { "fields": [...], "settings"?: {...} } } }. | |
| context | No | Why you're calling this (activity log). | |
| ifMatch | No | hash from get_collection_schema (stale → 409 conflict). null = the schema must not exist yet. Omit to write unconditionally. |