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

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

A4.8/5.0
Behavior5/5

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

Goes well beyond annotations: explains that a table or field omitted is dropped on next deploy, that the save is not a deploy, that a deploy-refused schema is refused here with nothing saved, and that the response carries 'diff', 'plan' and the new 'version'. It also documents the optimistic-concurrency 409 behavior tied to expected_version.

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?

Long but well-organized with bolded headers and bullets, and the most important fact (whole-schema replacement, destructive) is front-loaded. The rules blocks are dense but each line carries actionable constraint information, so it is justified rather than padded.

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, nested-object tool with no output schema, the description covers mutation semantics, migration constraints, ordering of calls, error/refusal behavior, and the shape of the response (diff/plan/version). An agent has everything needed to invoke it safely.

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?

Schema coverage is 100%, so the baseline is 3; the description adds extra meaning on top, notably the FLAT format requirement, per-type default rules (max_length 255, precision/scale 10,2), forbidden fields, and the concurrency purpose of expected_version in the workflow.

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?

States a precise verb+resource+scope: 'Replace a project's WHOLE schema (saves to database, does NOT deploy).' It also immediately distinguishes itself from sibling patch_schema and drop_schema_items, so an agent can route correctly without opening either schema.

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?

Explicitly names when to use it ('For a new data model or a template'), when not to ('To change part of a schema use patch_schema'), and the alternative for dropping ('drop_schema_items'). The numbered WORKFLOW gives a concrete call sequence including preview_schema_change and deploy steps.

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.