Contentstack · template

Catch a changed link field in a Contentstack stack export

A link deep in the menu had a title and an address. Now it is plain text.

Import your Contentstack content model once, then get pass or fail for each change, with the name of every field that breaks. Recorded with Compass, the starter stack that Contentstack publishes.

What you get

You import the content types of a stack once. After the next change, your assistant compares the new export with them and names each removed field and each changed type, also inside groups. The answer is a pass or a fail.

What we didWhat CoreModels answeredTime
Imported the files of 26 March 20254 types in the model5 s
Audited the files of 6 May 2025fail: 1 error (a field changed type)2 s
Audited the first files againpass: 0 errors1 s

Recorded on 4 December 2026 with Compass, the starter stack that Contentstack publishes (repository). Between March and May 2025 its authors changed one field three levels down in the menu: the external link went from a link, with a title and an address, to plain text. 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 Contentstack login. CoreModels reads files from public links.

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 26 March 2025, read from GitHub.

Create a CoreModels project named "Contentstack example". Then call import_vendor_project on it with vendor "contentstack" and these links in artifactUrls (name: link):
content_types/menu.json: https://raw.githubusercontent.com/contentstack/compass-starter-stack/7d79d7973540d65c8a21b489582ee41b5e87427b/stack/content_types/menu.json
content_types/home_page.json: https://raw.githubusercontent.com/contentstack/compass-starter-stack/7d79d7973540d65c8a21b489582ee41b5e87427b/stack/content_types/home_page.json

Your assistant calls create_project, then import_vendor_project. The answer we got:

import_vendor_project (part of the answer)

{
  "success": true,
  "vendor": "contentstack",
  "datasetsAdded": 4,
  "nodesEnriched": 19,
  "errors": []
}

Your model has 4 types now. Each has its fields, with the type from Contentstack.

3. Audit the newer version

Between March and May 2025 its authors changed one field three levels down in the menu: the external link went from a link, with a title and an address, to plain text.

Now call audit_vendor_project on the same project with vendor "contentstack" and the newer files in artifactUrls. Tell me the gate and list every Error:
content_types/menu.json: https://raw.githubusercontent.com/contentstack/compass-starter-stack/164ea61bb5d0c13561e21c64aa481306840e7010/stack/content_types/menu.json
content_types/home_page.json: https://raw.githubusercontent.com/contentstack/compass-starter-stack/164ea61bb5d0c13561e21c64aa481306840e7010/stack/content_types/home_page.json

Your assistant calls audit_vendor_project. The answer we got:

audit_vendor_project (part of the answer)

{
  "gate": "fail",
  "errorCount": 1,
  "warningCount": 11,
  "findings": [
    {
      "severity": "Error",
      "code": "field-type-drift",
      "subject": "menu.sections.group.links.group.external_link",
      "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 links. 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": 9
}

Now with your own project

The JSON files from csdx cm:stacks:export, one for each content type. Run this, then give your assistant the prompt.

csdx cm:stacks:export -k YOUR_STACK_API_KEY --data-dir ./stack --module content-types
Create a CoreModels project for our Contentstack content model. Import the content type files of our stack export (stack/content_types/*.json) with import_vendor_project, vendor "contentstack". 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.

for f in stack/content_types/*.json; do [ -f "$f" ] || continue; jq -n --arg n "$f" --rawfile t "$f" '{($n): $t}'; done |
  jq -s '{artifacts: add, failOn: "error"}' |
  curl -sS -X POST "https://go.coremodels.io/v1/$PROJECT_ID/integrations/contentstack/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.
  • The parts of a modular block are not compared. The answer says so for each such field.
  • CoreModels reads the files you give it. It has no login to Contentstack and it writes nothing back.

← Back to Contentstack

Start building

14-day free trial. Builder $49/mo after the trial. Cancel any time.