Skip to main content
Glama

contentrain_model_save

DestructiveIdempotent

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

NameRequiredDescriptionDefault
idYesModel ID (kebab-case, e.g. "blog-post")
i18nYesWhether this model supports localization
kindYesModel kind
nameYesHuman-readable name
domainYesContent domain (e.g. "blog", "marketing", "system")
fieldsNoField definitions (not needed for dictionary)
localesNoThe 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.
descriptionNoModel description
title_fieldYesName 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_pathNoFramework-relative path for content files (e.g. "content/blog", "locales"). When set, content is written here instead of .contentrain/content/
locale_strategyNoHow locale is encoded in file names. Default: "file"

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.0.42
    • addedInput schema / properties / locales
      Added value: +{
      +  "description": "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.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  2. Addedv1.0.29
  3. Removedv1.0.28
  4. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare destructiveHint=true and idempotentHint=true, but the description adds genuinely new context: changes are auto-committed to git and .contentrain/ files must not be hand-edited afterward. It stops short of explaining why the operation is destructive (e.g., whether an update replaces existing fields and can orphan content).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences, front-loaded with the core action and followed by the operational hazard. Nothing is redundant and the warning is placed where it will be read.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 11-parameter mutation tool with nested objects and no output schema, the description covers purpose and the git side-effect but leaves update semantics (does an update replace the whole definition?), failure behavior, and the meaning of the returned result unexplained. Adequate as a minimum-viable definition, not complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all 11 parameters, including the nested field-definition object, are already documented in the schema. The description adds no parameter-level meaning such as merge-versus-replace semantics for `fields` or required ordering of `id` versus `name`, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb+resource pair ("Create or update a model definition") that is unambiguous about the operation. It does not explicitly distinguish itself from siblings such as contentrain_model_delete or contentrain_scaffold, but the resource noun (model) already separates it from the content/vocabulary tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied by "Create or update" — an agent can infer this is the upsert entry point for model definitions, but there is no explicit when-to-use versus contentrain_scaffold, contentrain_model_delete, or contentrain_init. No prerequisites (e.g., whether init must run first) are stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.