contentrain_model_save
Create or update content model definitions, auto-committing changes to Git to keep content structure version-controlled.
Instructions
Create or update a model definition. Changes are auto-committed to git — do NOT manually edit .contentrain/ files after calling this tool.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Model ID (kebab-case, e.g. "blog-post") | |
| i18n | Yes | Whether this model supports localization | |
| kind | Yes | Model kind | |
| name | Yes | Human-readable name | |
| domain | Yes | Content domain (e.g. "blog", "marketing", "system") | |
| fields | No | Field definitions (not needed for dictionary) | |
| description | No | Model description | |
| title_field | Yes | Name of the field shown as an entry's title in listings, pickers and relation references. Must name a field on this model whose type is string, text, slug, email, url, code, markdown or richtext. Dictionary models have no fields — use "key". | |
| content_path | No | Framework-relative path for content files (e.g. "content/blog", "locales"). When set, content is written here instead of .contentrain/content/ | |
| locale_strategy | No | How locale is encoded in file names. Default: "file" |