Catch a content model change before it breaks the site
Three text fields became rich text. Every page that printed them had to change.
Import your Contentful content model once, then get pass or fail for each change, with the name of every field that breaks. Recorded with the Contentful starter blog, the Gatsby example that Contentful publishes.
What you get
You import a content model once. After the next change, your assistant compares the new export with it and names each field that was removed or changed type. The answer is a pass or a fail, so a script can use it.
| What we did | What CoreModels answered | Time |
|---|---|---|
| Imported the file of 6 May 2020 | 2 types in the model | 8 s |
| Audited the file of 6 May 2022 | fail: 3 errors (a field changed type) | 3 s |
| Audited the first file again | pass: 0 errors | 1 s |
Recorded on 4 December 2026 with the Contentful starter blog, the Gatsby example that Contentful publishes (repository). In 2022 its authors changed three fields from Markdown text to rich text. The delivery API then sends a JSON document where a page expected a string. Licence: MIT.
What you need
- A CoreModels account with one project. Every plan starts with a 14-day free trial; a card is required to start.
- An assistant that can use MCP servers, for example Claude Code or Cursor.
- No Contentful login. CoreModels reads one file from a public link.
Run it
1. Connect your assistant
In Claude Code, run this command. Then sign in when it asks. This address can write to your projects, because an import creates a model.
claude mcp add --transport http coremodels https://go.coremodels.io/mcp-admin
Cursor, Claude Desktop and other clients: connect guide.
2. Import the version the site was built on
This is the content model of 6 May 2020, read from GitHub.
Create a CoreModels project named "Contentful example". Then call import_vendor_project on it with vendor "contentful" and this link in artifactUrls (name: link):
export: https://raw.githubusercontent.com/contentful/starter-gatsby-blog/7ac74c7c38a65cb564647ca712e52dfb9ae74d17/contentful/export.json
Your assistant calls create_project, then import_vendor_project. The answer we got:
import_vendor_project (part of the answer)
{
"success": true,
"vendor": "contentful",
"datasetsAdded": 2,
"nodesEnriched": 20,
"errors": []
}
Your model has 2 types now. Each has its fields, with the type from Contentful.
3. Audit the newer version
In 2022 its authors changed three fields from Markdown text to rich text. The delivery API then sends a JSON document where a page expected a string.
Now call audit_vendor_project on the same project with vendor "contentful" and the newer file in artifactUrls. Tell me the gate and list every Error:
export: https://raw.githubusercontent.com/contentful/starter-gatsby-blog/b7fe2e6194c90f364ef18856833750276ac3c43f/contentful/export.json
Your assistant calls audit_vendor_project. The answer we got:
audit_vendor_project (part of the answer)
{
"gate": "fail",
"errorCount": 3,
"warningCount": 0,
"findings": [
{
"severity": "Error",
"code": "field-type-drift",
"subject": "person.shortBio",
"message": "Field type changed since the last import."
},
{
"severity": "Error",
"code": "field-type-drift",
"subject": "blogPost.description",
"message": "Field type changed since the last import."
},
{
"severity": "Error",
"code": "field-type-drift",
"subject": "blogPost.body",
"message": "Field type changed since the last import."
}
]
}
An audit only reads. The model still holds the first version.
4. Check that the gate also passes
A check that always fails is of no use. Audit the first version again.
Call audit_vendor_project again, this time with the first link. The gate must be pass.
Your assistant calls audit_vendor_project. The answer we got:
audit_vendor_project (part of the answer)
{
"gate": "pass",
"errorCount": 0,
"warningCount": 0
}
Now with your own project
One JSON file, the same file contentful space export writes. Run this, then give your assistant the prompt.
contentful space export --space-id YOUR_SPACE --skip-content --content-file export.json
Create a CoreModels project for our Contentful content model. Import your Contentful export (export.json) with import_vendor_project, vendor "contentful". Then audit the same files and show me the gate. Keep the project id: we will audit each later change against it.
In a pull request
This command gives the same answer without an assistant. It needs jq, a project id and an API key from Settings, API Keys. It ends with an error when the gate is fail, so a pull request check stops.
jq -n --rawfile f export.json '{artifacts: {"export": $f}, failOn: "error"}' |
curl -sS -X POST "https://go.coremodels.io/v1/$PROJECT_ID/integrations/contentful/audit" -H "Authorization: Bearer $COREMODELS_KEY" -H "Content-Type: application/json" -d @- |
jq -e '.data | .gate, (.findings[] | select(.severity == "Error") | .code + " " + .subject), (.gate == "pass")'
The service answers 200 also when the gate is fail. Read gate, as the command does. If the command prints null, no file was found at that path.
What it does not do
- A field that becomes required is not reported.
- A content type that is deleted is not reported. Its fields are no longer compared.
- CoreModels reads the file you give it. It has no login to Contentful and it writes nothing back.
14-day free trial. Builder $49/mo after the trial. Cancel any time.