Skip to main content
Glama

Update Schema

update_schema
DestructiveIdempotent

Replace a project's WHOLE schema (saves to database, does NOT deploy). DESTRUCTIVE: a table or field the schema leaves out is dropped by the next deploy.

For a new data model or a template. To change part of a schema use patch_schema, and drop_schema_items to drop; sending back a large schema to change one field risks changing something else on the way.

⚠️ Follow ALL rules from create_project: • FLAT format (no 'fields' nesting) • string: max_length (default 255) • decimal: precision + scale (default 10, 2) • Use "datetime" NOT "timestamp" • DON'T define: id, created_at, updated_at, row_version • NEVER create users/customers/employees tables (use app_users)

⚠️ MIGRATION RULES: • New fields MUST be "required": false OR have "default" value • Cannot add required field without default to existing tables

WORKFLOW:

  1. get_schema to see the current schema (its 'version' pins the save)

  2. preview_schema_change with the new schema: check 'diff' and 'plan'

  3. update_schema (pass expected_version to be refused if someone else saved meanwhile)

  4. deploy_staging, then get_job_status

A schema the deploy would refuse is refused here, and nothing is saved. The answer carries 'diff', 'plan' and the new 'version'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
schemaYesNew JSON schema in FLAT format (table_name → field_name → properties) — the WHOLE schema. Every field MUST have a 'type' property.
project_idYesProject ID (UUID)
expected_versionNoThe 'version' a get_schema read answered. The save is refused (409) when the saved schema changed since, so two editors never overwrite each other silently.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • removedInput schema / properties / dry_run
      Removed value: -{
      -  "description": "Save nothing: answer the property-level diff against the saved schema and the migration plan a deploy would run.",
      -  "type": "boolean"
      -}
    • changedInput schema / properties / schema / description
      Previous value: -"New JSON schema in FLAT format (table_name → field_name → properties). Every field MUST have a 'type' property."New value: +"New JSON schema in FLAT format (table_name → field_name → properties) — the WHOLE schema. Every field MUST have a 'type' property."
  2. Changed2 schema fields changed
    • changedInput schema / properties / dry_run / description
      Previous value: -"Preview the planned migration (renames/drops/creates) without saving or deploying. Nothing is applied."New value: +"Save nothing: answer the property-level diff against the saved schema and the migration plan a deploy would run."
    • addedInput schema / properties / expected_version
      Added value: +{
      +  "description": "The 'version' a get_schema read answered. The save is refused (409) when the saved schema changed since, so two editors never overwrite each other silently.",
      +  "type": "string"
      +}
  3. Changed1 schema field changed
    • addedInput schema / properties / dry_run
      Added value: +{
      +  "description": "Preview the planned migration (renames/drops/creates) without saving or deploying. Nothing is applied.",
      +  "type": "boolean"
      +}
  4. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.