contentrain_model_save
Create or update a content model definition and auto-commit the change to git, so you can define fields, locales, and model settings without manually editing .contentrain/ files.
Instructions
Create or update a model definition. Changes are auto-committed to git — do NOT manually edit .contentrain/ files after calling this tool.
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": {
"id": "<id>",
"name": "<name>",
"kind": "<kind>",
"domain": "<domain>",
"i18n": "<i18n>",
"title_field": "<title_field>"
},
"name": "contentrain_model_save"
}
}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) | |
| locales | No | The project locales this model's content covers — a subset of config.locales.supported. Omit it (the default) and the model covers every supported locale, which is what validation checks parity against. Declare it only when the content genuinely exists in a subset, e.g. a partially-translated site. | |
| 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" |