Skip to main content
Glama

Update collection schema

update_collection_schema
Destructive

Define or update the field schema of a collection. Pass the FULL ordered list of fields you want. This is a wholesale replace at the schema level (it is not a JSON Merge Patch).

expectedUpdatedAt is required: the updatedAt from get_collection (or from create_collection or the previous update_collection_schema). The save is refused if the collection changed since, for example a field a teammate just added in the dashboard; then call get_collection again, merge your fields into the current list, and retry.

Each field has:

  • name: string identifier (used as the key in entry content)

  • label: human-readable label

  • type: one of name, slug, text, html, number, checkbox (a yes/no value; boolean is saved as checkbox), date, image, media, icon, option, reference, related. The legacy select, textarea, email and url types are accepted so a collection that already has them can be saved back unchanged; use option and text for new fields.

  • required: optional boolean

  • helpText: optional help string

  • options: for option type, a comma-separated string of choices; for reference type, the target collection id; otherwise empty

  • list: optional boolean (allow array of values)

  • to: alternative for reference target id

  • config: optional flat object of type-specific settings. For date fields: { format, time, timeFormat } where format is one of "MMM D, YYYY" (default), "MMMM D, YYYY", "D MMM YYYY", "D MMMM YYYY", "MMM D", "MMMM D", "ddd, MMM D, YYYY", "dddd, MMMM D, YYYY", "MM/DD/YYYY", "DD/MM/YYYY", "DD.MM.YYYY", "YYYY-MM-DD", "MMM YYYY", "MMMM YYYY", "YYYY"; time is a boolean (false = calendar date only, true = date with time; this decides the value shape entries store); timeFormat is "12h" or "24h". A field sent without a config key keeps its stored config; config: null clears it. Other types take no config.

An icon field holds one icon per entry: a library icon or the site's own uploaded SVG or PNG. Use it for the small symbol beside a service, feature or step; photos and logos stay media.

A reference field links to entries of another collection. To link entries of the same collection, such as related posts, use a related field: a reference to the collection itself is refused.

Every collection has built-in Name and Slug fields (type name and type slug); they are required, never list, and their values are not part of content: the entry's name and URL slug live on the entry itself and change through update_entry. Keep both in the list when updating a collection that has them (a built-in cannot be removed or renamed); a collection holds at most one of each. A legacy collection whose name or slug is a plain text field can convert it by changing that field's type to the built-in one. Reserved field names: _raw, _icon, _pagination, _filters.

The schema has no draft: live listings and entry pages read it as soon as it is saved. A field left out of the list is removed from the schema, and changing a date field's config, or removing or retyping a date field, republishes every published entry page of the collection.

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": {
      "projectId": "<projectId>",
      "collectionId": "<collectionId>",
      "expectedUpdatedAt": "<expectedUpdatedAt>",
      "fieldSchema": "<fieldSchema>"
    },
    "name": "update_collection_schema"
  }
}

Input Schema

NameRequiredDescriptionDefault
projectIdYesThe project ID
fieldSchemaYesFull ordered list of fields. Replaces the collection's existing fieldSchema.
collectionIdYesThe collection ID
expectedUpdatedAtYesupdatedAt as read from get_collection (or returned by create_collection or the last update_collection_schema); the save is refused if the collection changed since

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / expectedUpdatedAt
      Added value: +{
      +  "description": "updatedAt as read from get_collection (or returned by create_collection or the last update_collection_schema); the save is refused if the collection changed since",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • changedInput schema / properties / fieldSchema / items / properties / type / enum
      Previous value: -[
      -  "name",
      -  "slug",
      -  "text",
      -  "html",
      -  "number",
      -  "boolean",
      -  "date",
      -  "image",
      -  "option",
      -  "reference",
      -  "media",
      -  "icon"
      -]New value: +[
      +  "name",
      +  "slug",
      +  "text",
      +  "html",
      +  "number",
      +  "checkbox",
      +  "boolean",
      +  "date",
      +  "image",
      +  "media",
      +  "icon",
      +  "option",
      +  "reference",
      +  "related",
      +  "select",
      +  "textarea",
      +  "email",
      +  "url"
      +]
    • changedInput schema / required
      Previous value: -[
      -  "projectId",
      -  "collectionId",
      -  "fieldSchema"
      -]New value: +[
      +  "projectId",
      +  "collectionId",
      +  "expectedUpdatedAt",
      +  "fieldSchema"
      +]
  2. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations declare destructiveHint=true and openWorldHint=true, but the description goes well past them: the schema has no draft and goes live immediately, omitted fields are removed, changing or removing a date config republishes every published entry page, built-in Name/Slug cannot be removed or renamed, and reserved names are listed. It also documents the concurrency refusal condition — exactly the irreversible-changes context an agent needs before calling a destructive tool.

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

Conciseness4/5

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

The critical constraint (pass the full ordered list, wholesale replace) is front-loaded, and the field-by-field section is structured as bullets with the destructive behavior saved for the end. It is long, but the length is largely earned by the nested field schema; some prose, such as the icon-versus-media paragraph and the full date-format enumeration, could be tightened without losing agent-relevant information.

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

Completeness5/5

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

For a destructive, no-output-schema, nested-parameter tool, the description covers everything an agent needs: ordering semantics, replacement semantics, concurrency preconditions, per-field type meaning, config handling, and immediate live-publication side effects. Nothing material is left to inference.

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

Parameters5/5

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

Schema description coverage is already 100%, but the description adds substantial meaning beyond the schema: it explains what each field type is for, that legacy types are accepted only for round-tripping, that options carries a comma-separated list for option fields versus a target collection id for reference fields, that a missing config key preserves stored config while null clears it, and it enumerates the date format values. This is well beyond what the JSON Schema encodes.

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

Purpose5/5

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

"Define or update the field schema of a collection" gives a specific verb and resource, and the follow-up sentences immediately disambiguate the operation from a patch ("wholesale replace at the schema level (it is not a JSON Merge Patch)"). The agent knows exactly what this mutates, unlike the many entry/page-level siblings in the list.

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

Usage Guidelines5/5

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

It spells out the preconditions (expectedUpdatedAt must come from get_collection/create_collection/previous call), the retry recipe when the save is refused (re-read, merge, retry), and it routes to alternatives: use a related field rather than a self-referencing reference, use icon rather than media for symbols, and change name/slug values via update_entry. That is explicit when-to-use and when-to-use-something-else.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.