put_collection_schema
Replace the whole field schema (draft; publish makes it live). Read it with get_collection_schema first and send it back edited. Collection keys exactly as list_collections returns 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 (title, date, excerpt, tags, image, url, slug, …; author only as text), 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 (values stay on the posts). Values live in put_post meta.custom; writes then return fieldWarnings (soft, never blocking). 400 invalid_collection_schema lists issues; 409 conflict = stale ifMatch.
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 | Yes | One sentence: why you are calling this tool and what you are trying to accomplish. Stored on the site's activity log and visible to everyone on the site — never put secrets or personal data here. | |
| ifMatch | No | hash from get_collection_schema (stale → 409 conflict). null = the schema must not exist yet. Omit to write unconditionally. | |
| guestToken | No | Guest token from start_site. Send it on every call until claim_site. Omit when this chat is already signed in to Dotsy. |