Skip to main content
Glama
@cmssy/mcp-server

@cmssy/mcp-server

Official

Create model

create_model

Defines a new data model in the workspace by specifying fields, per-language labels, relations, and optional commerce or accounts capabilities so records can be stored and served.

Instructions

Create a data model in the workspace. Every field label (and description) is text per language code of the workspace: { en: "Title", pl: "Tytuł" }. Field types include select/multiselect (provide options as [{ value, label }] - the value is what records store), relation (link to another model via relationTo = the target model's slug + relationType), and object/list (nested fields/itemFields). Optional model-level config: slug, description, icon, color, displayField, defaultSort, statusField, product (commerce capability: enabled, priceField, skuField, inventoryField, variantAxes), auth (accounts: enabled, identityField, companyField for a B2B company link - a relation to a model with Company enabled, registration - "open" by default, "closed" when only admins create accounts, email - { enabled, links, templates } for cmssy sending account emails itself, off by default; a field's memberCanSet opens it to the member on their own account and at sign-up - registration accepts only those fields, never password fields or the company field), company ({ enabled }: its records are the companies an accounts model links; a model is at most one of product, account (auth) or company), uniqueFields (field keys whose value must be unique - lets import_records update by that key) and deliveryAccess - a model is "none" (admin only) by default, so pass "public" when the user's app must read it through the delivery API. urlPattern (e.g. /p/{slug}) says where its records live on the storefront, so their url becomes a working link - ask the user for their route rather than inventing one.

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": {
      "name": "<name>",
      "fields": "<fields>"
    },
    "name": "create_model"
  }
}

Input Schema

NameRequiredDescriptionDefault
authNoAccounts config PATCH: omitted keys keep their stored values, null unlinks the company. enabled turns the model into an accounts (customer) model.
iconNoLucide icon name, defaults to 'database'
nameYes
slugNoURL-safe slug (lowercase). Derived from name when omitted.
colorNo
fieldsYes
companyNoCompany capability PATCH: an omitted enabled keeps the stored value. A model is at most one of product, account (auth) or company. Turning it off is refused while an accounts model's companyField links this model.
productNoProduct capability config PATCH: omitted keys keep their stored values (defaults on first enable: skuField 'sku', priceField 'price', inventoryField 'inventory', variantAxes [], name/image/taxRate overrides null). A product is priced in the workspace's defaultCurrency through priceField; prices in additional currencies are set with set_product_currency_prices and set_product_variants, never through a field. The cart reads every product field through these roles - there is no per-cart field mapping. While the product is enabled, every role is graded against the key it resolves to on any call that changes product, fields, removeFields or displayField, so a fields-only update can be refused for a role it never named; a disabled product is not graded until it is enabled. Each role below names the types it accepts and when its field must exist. String-valued types: text, textarea, richText, markdown, color, url, email, select, radio, phone, link, file, form, hidden. A translatable field is one with localized: true on the model. E.g. {variantAxes: []} clears the axes without touching anything else.
urlPatternNoWhere this model's records live on the storefront, appended to the site's public site URL, e.g. /p/{slug} or /{locale}/shop/{category.slug}/{slug}. Must start with /. Tokens: {fieldKey} (a visible text, number, date, select or radio field of this model), {relationField.fieldKey} (that field of the record a single relation links to) and {locale}. Unknown fields or bad token syntax are refused. null removes it.
defaultSortNo
descriptionNo
statusFieldNoEnable record lifecycle states with allowed transitions
displayFieldNoField key used as the record's display label in UI
uniqueFieldsNoKeys of top-level text, email, url, phone or number fields whose value no two records may share (not translatable fields, not the product price/stock fields). Replaces the whole list; [] removes every constraint. Refused while existing records already share a value - the error lists them.
deliveryAccessNoWho can read this model through the delivery API: "public" (any app with the workspace endpoint - required for a content API), "members" (signed-in site members only), "none" (admin only, the default).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed33 schema fields changedv0.73.2
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / definitions / __schema0 / properties / defaultValue / description
      Added value: +"Default value, always a string. It seeds only a field that holds one string, number or boolean - a structured type (media, multiselect, repeater, list, pageSelector, object, table, json) or a hasMany relation is refused on save."
    • addedInput schema / definitions / __schema0 / properties / description / additionalProperties
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / definitions / __schema0 / properties / description / description
      Added value: +"Help text under the field, per language."
    • addedInput schema / definitions / __schema0 / properties / description / propertyNames
      Added value: +{
      +  "minLength": 1,
      +  "type": "string"
      +}
    • changedInput schema / definitions / __schema0 / properties / description / type
      Previous value: -"string"New value: +"object"
    • addedInput schema / definitions / __schema0 / properties / label / additionalProperties
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / definitions / __schema0 / properties / label / description
      Added value: +"The field's label per language code of the workspace: { en: 'Size', pl: 'Rozmiar' }. At least one language."
    • removedInput schema / definitions / __schema0 / properties / label / minLength
      Removed value: -1
    • addedInput schema / definitions / __schema0 / properties / label / propertyNames
      Added value: +{
      +  "minLength": 1,
      +  "type": "string"
      +}
    • changedInput schema / definitions / __schema0 / properties / label / type
      Previous value: -"string"New value: +"object"
    • addedInput schema / definitions / __schema0 / properties / maxDecimals
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maximum": 9007199254740991,
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "For a 'number' field: most digits after the decimal point (0 = whole numbers). null clears the rule."
      +}
    • addedInput schema / definitions / __schema0 / properties / maxItems
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maximum": 9007199254740991,
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Most items a list-valued field accepts (same types as minItems). null clears the rule."
      +}
    • addedInput schema / definitions / __schema0 / properties / maxSize
      Added value: +{
      +  "anyOf": [
      +    {
      +      "exclusiveMinimum": 0,
      +      "maximum": 9007199254740991,
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "For a 'media' field: largest accepted asset, in bytes. null clears the rule."
      +}
    • addedInput schema / definitions / __schema0 / properties / memberCanSet
      Added value: +{
      +  "description": "On an accounts model: opens the field to the member - they may change it on their own account and send it at sign-up (registration accepts only these fields; password fields and the company field never, whatever the flag). Top-level fields only, never a hidden or company field. On the login field it opens the login change flow, on the password field the password change.",
      +  "type": "boolean"
      +}
    • addedInput schema / definitions / __schema0 / properties / minItems
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maximum": 9007199254740991,
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Fewest items a list-valued field accepts (repeater, list, multiselect, hasMany relation, media with multiple: true). Ignored on a single-value field. null clears the rule."
      +}
    • changedInput schema / definitions / __schema0 / properties / options / description
      Previous value: -"Choices for a 'select' or 'multiselect' field. Required (non-empty) for those types."New value: +"Choices for a 'select' or 'multiselect' field: [{ value: 's', label: { en: 'Small' } }]. Required (non-empty) for those types; values must be distinct."
    • addedInput schema / definitions / __schema0 / properties / options / items / properties
      Added value: +{
      +  "label": {
      +    "additionalProperties": {
      +      "type": "string"
      +    },
      +    "description": "What the editor sees, per language: { en: 'Small', pl: 'Mały' }.",
      +    "propertyNames": {
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "type": "object"
      +  },
      +  "value": {
      +    "description": "The stored value - what a record holds and filters match.",
      +    "minLength": 1,
      +    "type": "string"
      +  }
      +}
    • addedInput schema / definitions / __schema0 / properties / options / items / required
      Added value: +[
      +  "value",
      +  "label"
      +]
    • changedInput schema / definitions / __schema0 / properties / options / items / type
      Previous value: -"string"New value: +"object"
    • addedInput schema / definitions / __schema0 / properties / validationMessage
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Shown instead of the default message when any rule on this field fails. null clears it."
      +}
    • addedInput schema / properties / auth
      Added value: +{
      +  "description": "Accounts config PATCH: omitted keys keep their stored values, null unlinks the company. enabled turns the model into an accounts (customer) model.",
      +  "properties": {
      +    "companyField": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Relation field (hasOne) naming the customer's company; it must link a model with the Company capability enabled (company: { enabled: true }). null unlinks the company."
      +    },
      +    "email": {
      +      "description": "Account emails PATCH: omitted keys keep their stored values, links merge, templates replace the list.",
      +      "properties": {
      +        "enabled": {
      +          "description": "true: cmssy sends verification, password reset and login change emails itself through the workspace's default email configuration (refused when there is none). false (default): the app's webhook sends them. The account.* webhook events fire either way, so an app that also mails sends a second email.",
      +          "type": "boolean"
      +        },
      +        "links": {
      +          "description": "URL template per email, merged into the stored ones. Placeholders: {siteUrl} (site config publicSiteUrl), {token} (required), {locale}; must give an absolute http(s) URL, and {siteUrl} needs the site's public URL set. Defaults: {siteUrl}/verify-email?token={token}, {siteUrl}/reset-password?token={token}, {siteUrl}/confirm-login-change?token={token}.",
      +          "properties": {
      +            "loginChange": {
      +              "maxLength": 500,
      +              "minLength": 1,
      +              "type": "string"
      +            },
      +            "passwordReset": {
      +              "maxLength": 500,
      +              "minLength": 1,
      +              "type": "string"
      +            },
      +            "verification": {
      +              "maxLength": 500,
      +              "minLength": 1,
      +              "type": "string"
      +            }
      +          },
      +          "type": "object"
      +        },
      +        "templates": {
      +          "description": "Copy overrides per kind and locale; replaces every stored override ([] drops them all). Variables: {{siteName}}, {{login}}, {{expiresIn}}. A kind/locale without one uses the built-in copy (en, de, es, pl, fr).",
      +          "items": {
      +            "properties": {
      +              "body": {
      +                "maxLength": 5000,
      +                "minLength": 1,
      +                "type": "string"
      +              },
      +              "ctaLabel": {
      +                "description": "Button label",
      +                "maxLength": 60,
      +                "minLength": 1,
      +                "type": "string"
      +              },
      +              "heading": {
      +                "maxLength": 200,
      +                "minLength": 1,
      +                "type": "string"
      +              },
      +              "kind": {
      +                "enum": [
      +                  "verification",
      +                  "passwordReset",
      +                  "loginChange"
      +                ],
      +                "type": "string"
      +              },
      +              "locale": {
      +                "description": "Language code the copy is for, e.g. en, pl, de-AT",
      +                "maxLength": 16,
      +                "pattern": "^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$",
      +                "type": "string"
      +              },
      +              "subject": {
      +                "maxLength": 200,
      +                "minLength": 1,
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "kind",
      +              "locale",
      +              "subject",
      +              "heading",
      +              "body",
      +              "ctaLabel"
      +            ],
      +            "type": "object"
      +          },
      +          "maxItems": 60,
      +          "type": "array"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "enabled": {
      +      "type": "boolean"
      +    },
      +    "identityField": {
      +      "description": "Email or text field that identifies the account (default 'email')",
      +      "type": "string"
      +    },
      +    "lockout": {
      +      "properties": {
      +        "enabled": {
      +          "type": "boolean"
      +        },
      +        "lockMinutes": {
      +          "maximum": 9007199254740991,
      +          "minimum": 1,
      +          "type": "integer"
      +        },
      +        "maxAttempts": {
      +          "maximum": 9007199254740991,
      +          "minimum": 1,
      +          "type": "integer"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "registration": {
      +      "description": "Who may sign up. 'open' (the default on a new model): anyone, through siteMember.register. 'closed': siteMember.register refuses every new sign-up; admins still create accounts. Closing does not touch accounts already registered - a pending one can still verify its email, so suspend or delete those.",
      +      "enum": [
      +        "open",
      +        "closed"
      +      ],
      +      "type": "string"
      +    },
      +    "strategy": {
      +      "enum": [
      +        "local",
      +        "oauth",
      +        "external"
      +      ],
      +      "type": "string"
      +    },
      +    "verification": {
      +      "properties": {
      +        "required": {
      +          "type": "boolean"
      +        }
      +      },
      +      "type": "object"
      +    }
      +  },
      +  "type": "object"
      +}
    • addedInput schema / properties / company
      Added value: +{
      +  "description": "Company capability PATCH: an omitted enabled keeps the stored value. A model is at most one of product, account (auth) or company. Turning it off is refused while an accounts model's companyField links this model.",
      +  "properties": {
      +    "enabled": {
      +      "description": "true makes the model's records companies an accounts model's companyField can link.",
      +      "type": "boolean"
      +    }
      +  },
      +  "type": "object"
      +}
    • changedInput schema / properties / product / description
      Previous value: -"Product capability config PATCH: omitted keys keep their stored values (defaults on first enable: skuField 'sku', priceField 'price', inventoryField 'inventory', variantAxes []). E.g. {variantAxes: []} clears the axes without touching anything else."New value: +"Product capability config PATCH: omitted keys keep their stored values (defaults on first enable: skuField 'sku', priceField 'price', inventoryField 'inventory', variantAxes [], name/image/taxRate overrides null). A product is priced in the workspace's defaultCurrency through priceField; prices in additional currencies are set with set_product_currency_prices and set_product_variants, never through a field. The cart reads every product field through these roles - there is no per-cart field mapping. While the product is enabled, every role is graded against the key it resolves to on any call that changes product, fields, removeFields or displayField, so a fields-only update can be refused for a role it never named; a disabled product is not graded until it is enabled. Each role below names the types it accepts and when its field must exist. String-valued types: text, textarea, richText, markdown, color, url, email, select, radio, phone, link, file, form, hidden. A translatable field is one with localized: true on the model. E.g. {variantAxes: []} clears the axes without touching anything else."
    • addedInput schema / properties / product / properties / imageField
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Field key holding the product image the cart snapshots. null clears the override; unset it resolves to 'image'. The field it resolves to must be a media field, a list of media, or a text or url field. A set key must also exist; only the unset default may be absent."
      +}
    • changedInput schema / properties / product / properties / inventoryField / description
      Previous value: -"Field key holding the stock count (default 'inventory')"New value: +"Field key holding the stock count (default 'inventory'). The field must be a number field. A key other than the default 'inventory' must exist."
    • addedInput schema / properties / product / properties / nameField
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Field key holding the product name the cart shows. null clears the override; unset it resolves to the model's displayField, then 'name'. The key it resolves to must name an existing string-valued field - always, set or not."
      +}
    • changedInput schema / properties / product / properties / priceField / description
      Previous value: -"Field key holding the unit price in minor units (default 'price')"New value: +"Field key holding the unit price in major units - the number a merchant types, 49 = $49.00; the server converts to minor units when pricing (default 'price'). Volume tiers and ad-hoc order lines are minor units - do not mix the two. The field must be a number field. It must exist while variantAxes is empty; a key other than the default 'price' must exist regardless."
    • changedInput schema / properties / product / properties / skuField / description
      Previous value: -"Field key holding the SKU (default 'sku')"New value: +"Field key holding the SKU (default 'sku'). The field must be string-valued and not translatable - the SKU is an identity, mirrored to one value per record and compared by equality. A key other than the default 'sku' must exist."
    • addedInput schema / properties / product / properties / taxRateField
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Field key holding the id of the tax rate (from the cart config) that applies to a record. null clears the override; unset it resolves to 'taxRate'. The field it resolves to must be string-valued and not translatable - the rate id is read from the record as stored, without resolving a locale. A set key must also exist; only the unset default may be absent."
      +}
    • changedInput schema / properties / product / properties / variantAxes / description
      Previous value: -"Field keys used as variant axes (e.g. ['size','color']). Every axis must be an existing select field on the model. Pass [] to clear all axes."New value: +"Field keys used as variant axes (e.g. ['size','color']). Every axis must name a distinct existing select field on the model with at least one option. Pass [] to clear all axes."
    • addedInput schema / properties / urlPattern
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Where this model's records live on the storefront, appended to the site's public site URL, e.g. /p/{slug} or /{locale}/shop/{category.slug}/{slug}. Must start with /. Tokens: {fieldKey} (a visible text, number, date, select or radio field of this model), {relationField.fieldKey} (that field of the record a single relation links to) and {locale}. Unknown fields or bad token syntax are refused. null removes it."
      +}
    • addedInput schema / required
      Added value: +[
      +  "name",
      +  "fields"
      +]
  2. First observedv0.73.1

TDQS

A3.9/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=false and destructiveHint=false, and the description fills in substantial behavior the annotations cannot: defaults (deliveryAccess 'none' by default, registration 'open' by default, account email sending 'off by default'), refusals (turning company off is refused while an accounts model links it, fields-only updates can be refused because roles are graded), and explicit instructions not to invent urlPattern routes. That is well beyond what the structured fields supply.

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

Conciseness3/5

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

The purpose is front-loaded, but the bulk is a wall of text with deeply nested parentheses and semicolon-chained clauses covering product, auth, email, company, unique fields and delivery access in one block. Every topic is relevant, yet the lack of structure (lists or paragraph breaks) makes it harder to scan than its content warrants.

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

Completeness4/5

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

For a 15-parameter, deeply nested creation tool with no output schema, the description covers the capability matrix (product/account/company mutual exclusion), defaults, and the delivery-access decision, which is the information an agent most needs before calling it. It does not state what a successful call returns (e.g. the model slug needed for downstream create_record or relationTo), which is a minor residual gap given no output schema exists.

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

Parameters4/5

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

At 67% schema coverage and 15 parameters with deep nesting, the description still adds cross-cutting meaning: how select/multiselect options relate to stored values, that relation targets use the target model's slug plus relationType, and that object/list use nested fields/itemFields. It also summarizes product, auth, company, uniqueFields and deliveryAccess semantics and reinforces urlPattern's purpose, though for many sub-keys the schema descriptions remain the deeper source.

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?

Opens with a specific verb and resource: 'Create a data model in the workspace', then enumerates field types and model-level capabilities so the agent knows the scope of the operation. It never names a sibling (e.g. update_model or get_model) to contrast against, so an agent must infer that modification is a different tool, which keeps it short of a 5.

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 guidance is implicit rather than explicit: the description implies you call this when a new model is needed, and it gives conditional advice such as passing deliveryAccess 'public' 'when the user's app must read it through the delivery API' and asking the user for a route. There is no statement of when not to use it or which tool to use instead for existing models or bulk data (import_records is mentioned only as a consumer of uniqueFields, not as an alternative).

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

Deploy Server

Other Tools