Skip to main content
Glama

update_schema_incremental

planning may be supplied alone to replace schema_definition.planning with {level: finite number, read_only?: boolean}; omission preserves it. Existing fields, reducers, row metadata, scope and grants remain in force.

Instructions

planning may be supplied alone to replace schema_definition.planning with {level: finite number, read_only?: boolean}; omission preserves it. Existing fields, reducers, row metadata, scope and grants remain in force. No planning declaration grants edits or execution. Incrementally update a schema by adding fields (fields_to_add — minor version bump), removing fields (fields_to_remove — major version bump; observation data preserved, snapshot-excluded until re-added), or changing the identity rule (canonical_name_fields — major version bump). Creates a new schema version and activates it immediately, so all new data stored after this call uses the updated schema. Optionally migrates existing raw_fragments to observations for historical data backfill.

canonical_name_fields re-keys how the type derives canonical_name / identity. Rules are ordered precedence with fallback — the first rule whose fields are all present wins, e.g. [{composite:["linkedin_url"]},"email","name"] keys on linkedin_url, else email, else name. Reach for it when same-name-different-entity collisions appear (e.g. a bulk import collapses distinct people who share a name because identity resolves on name alone). The existing reducer_config is preserved automatically, so this is the safe way to re-key without a full register_schema re-supply. Applies to NEW writes only — it does not retroactively re-key existing entities, so it will not by itself merge existing duplicates. Omit to keep the current rule; pass [] to clear it (succeeds only if the schema also declares identity_opt_out). The response echoes the resolved canonical_name_fields; call describe_entity_type first to see the current rule before replacing it.

Scope: omit user_specific to write to whichever scope your schema resolves to (your user-scoped override if you have one, else global); the response's scope (and user_id when scope is user) reports what was written. Pass user_specific: true or false only to override that. migrated_existing is true only when migrate_existing actually promoted fragments; migration_result.skipped says why any did not. If entity_type is rejected by a naming guard whose message names force: true as the remedy, retry with force: true.

On ERR_SCHEMA_SCOPE_MISMATCH (only after an explicit user_specific: false, when the type has no global registry row and no code-defined baseline) an active schema exists in a different scope than the call checked (details.guard_scope vs details.found_scope). Retry without user_specific, or with user_specific matching details.found_scope. Never call register_schema for that code — a second active row for the same entity_type risks dual-active corruption (#2374/#2378).

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": {
      "entity_type": "<entity_type>"
    },
    "name": "update_schema_incremental"
  }
}

Input Schema

NameRequiredDescriptionDefault
forceNoBypass the entity-type naming guards (forbidden test-artifact patterns and the plural-name guard) for this call only. Required when entity_type is rejected with a message naming "force: true" as the remedy — e.g. a name the plural guard misclassifies (like "hypothesis"). Does not affect any other validation.
user_idNoUser ID for user-specific schema (required if user_specific=true)
activateNoActivate schema immediately so it applies to new data (default: true). If false, schema is registered but not active.
planningNoReplace the registry planning-stratum declaration; omit to preserve. No edit or execution grant.
entity_typeYesEntity type to update
fields_to_addNoFields to add to schema
user_specificNoExplicit scope override. Omit this to write to whichever scope your own read of the schema resolved (global row, or your user-scoped override if you have one) — the common case, and the safe default. Pass true to create or extend a user-specific override for you even if you currently resolve the global row. Pass false to extend the global row even if you have a user-scoped override: the new global version is built from the current global schema, never from your override; if the type has no global registry row and no code-defined baseline (but has your user-scoped schema), the call returns ERR_SCHEMA_SCOPE_MISMATCH. The response's "scope" field reports which scope was actually written.
schema_versionNoNew schema version (auto-increments if not provided)
fields_to_removeNoField names to remove from schema (triggers major version bump). Observation data is preserved; fields can be restored by re-adding them later.
migrate_existingNoMigrate existing raw_fragments to observations for historical data backfill (default: false). Note: New data automatically uses updated schema after activation, migration is only for old data. The response's "migrated_existing" reflects whether anything actually promoted, and "migration_result.skipped" names any fragment groups that did not (e.g. ambiguous ownership, already promoted by a prior call) — a request with migrate_existing: true can legitimately promote zero fragments.
canonical_name_fieldsNoReplace the entity type's identity rule (how canonical_name / entity identity is derived). Triggers a major version bump. Each item is a single field name (string) or an all-required composite ({composite:[...]}). Rules are ORDERED PRECEDENCE WITH FALLBACK: the resolver uses the first rule whose fields are all present, not an unordered set. Example: [{"composite":["linkedin_url"]},"email","name"] keys on linkedin_url when present, else email, else name. Omit to keep the current rule. Passing [] clears the rule, but only succeeds when the schema also declares identity_opt_out; otherwise it is rejected (a schema must declare canonical_name_fields OR identity_opt_out). The existing reducer_config is preserved automatically — this is the safe way to re-key a type without reconstructing it. Applies to NEW writes only; it does NOT retroactively re-key existing entities (they keep their stored canonical_name until re-derived), so re-keying will not by itself merge existing duplicates. To see the current rule before replacing it, call describe_entity_type first; the update response also echoes the resolved canonical_name_fields.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.29.1
    • addedInput schema / properties / planning
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Replace the registry planning-stratum declaration; omit to preserve. No edit or execution grant.",
      +  "properties": {
      +    "level": {
      +      "type": "number"
      +    },
      +    "read_only": {
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "level"
      +  ],
      +  "type": "object"
      +}
  2. Changed4 schema fields changedv0.25.0
    • addedInput schema / properties / force
      Added value: +{
      +  "default": false,
      +  "description": "Bypass the entity-type naming guards (forbidden test-artifact patterns and the plural-name guard) for this call only. Required when entity_type is rejected with a message naming \"force: true\" as the remedy — e.g. a name the plural guard misclassifies (like \"hypothesis\"). Does not affect any other validation.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / migrate_existing / description
      Previous value: -"Migrate existing raw_fragments to observations for historical data backfill (default: false). Note: New data automatically uses updated schema after activation, migration is only for old data."New value: +"Migrate existing raw_fragments to observations for historical data backfill (default: false). Note: New data automatically uses updated schema after activation, migration is only for old data. The response's \"migrated_existing\" reflects whether anything actually promoted, and \"migration_result.skipped\" names any fragment groups that did not (e.g. ambiguous ownership, already promoted by a prior call) — a request with migrate_existing: true can legitimately promote zero fragments."
    • removedInput schema / properties / user_specific / default
      Removed value: -false
    • changedInput schema / properties / user_specific / description
      Previous value: -"Create user-specific schema variant (default: false)"New value: +"Explicit scope override. Omit this to write to whichever scope your own read of the schema resolved (global row, or your user-scoped override if you have one) — the common case, and the safe default. Pass true to create or extend a user-specific override for you even if you currently resolve the global row. Pass false to extend the global row even if you have a user-scoped override: the new global version is built from the current global schema, never from your override; if the type has no global registry row and no code-defined baseline (but has your user-scoped schema), the call returns ERR_SCHEMA_SCOPE_MISMATCH. The response's \"scope\" field reports which scope was actually written."
  3. Changed1 schema field changedv0.21.0
    • addedInput schema / properties / canonical_name_fields
      Added value: +{
      +  "description": "Replace the entity type's identity rule (how canonical_name / entity identity is derived). Triggers a major version bump. Each item is a single field name (string) or an all-required composite ({composite:[...]}). Rules are ORDERED PRECEDENCE WITH FALLBACK: the resolver uses the first rule whose fields are all present, not an unordered set. Example: [{\"composite\":[\"linkedin_url\"]},\"email\",\"name\"] keys on linkedin_url when present, else email, else name. Omit to keep the current rule. Passing [] clears the rule, but only succeeds when the schema also declares identity_opt_out; otherwise it is rejected (a schema must declare canonical_name_fields OR identity_opt_out). The existing reducer_config is preserved automatically — this is the safe way to re-key a type without reconstructing it. Applies to NEW writes only; it does NOT retroactively re-key existing entities (they keep their stored canonical_name until re-derived), so re-keying will not by itself merge existing duplicates. To see the current rule before replacing it, call describe_entity_type first; the update response also echoes the resolved canonical_name_fields.",
      +  "items": {
      +    "oneOf": [
      +      {
      +        "type": "string"
      +      },
      +      {
      +        "properties": {
      +          "composite": {
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          }
      +        },
      +        "required": [
      +          "composite"
      +        ],
      +        "type": "object"
      +      }
      +    ]
      +  },
      +  "type": "array"
      +}
  4. Addedv0.15.0
  5. Removedv0.14.0
  6. Addedv0.12.1
  7. Removedv0.11.0
  8. First observedv0.1.0

TDQS

A3.9/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden, and it does disclose a lot: activation is immediate, observation data survives field removal, identity changes apply only to new writes and do not merge existing duplicates, and scope is resolved server-side with the response reporting it. What it omits is the shape and cost of failure modes beyond one error, and any notion of reversibility or audit trail for the version bump itself, so the behavior picture is strong but not exhaustive.

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

Conciseness2/5

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

It opens with a paragraph about the optional planning override before ever stating the tool's main job, which inverts front-loading. Large blocks, especially canonical_name_fields and user_specific, repeat schema text almost word for word, and the same scope/error guidance appears in two places. The content is valuable but the structure buries the lede and duplicates structured fields.

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 an 11-parameter mutation tool with no annotations and no output schema, it covers activation semantics, scope resolution, migration skipping, naming-guard force retry, and one specific error recovery path, and it names several response fields the caller should read. Only a fuller account of the success response (new version identifier, counts of added or removed fields) would make it complete.

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

Parameters3/5

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

Schema description coverage is 100% and the schema descriptions already restate most of what the prose says — the canonical_name_fields paragraph, the planning paragraph, and the scope override text largely duplicate the schema verbatim. The description does add cross-parameter meaning the schema cannot: the mapping of each mutation to a major vs minor version bump, and the interplay between migrate_existing and response fields. Baseline 3 with modest added value is the correct call.

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?

The description names a specific verb and resource ('Incrementally update a schema') and enumerates the three supported mutations with their version-bump consequences (fields_to_add minor, fields_to_remove and canonical_name_fields major). It also implicitly distinguishes itself from register_schema by describing itself as the incremental, safe alternative that preserves reducer_config and existing grants.

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 gives explicit when-to-use guidance ('reach for it when same-name-different-entity collisions appear'), when not to bother ('omit to keep the current rule'), a prerequisite ('call describe_entity_type first'), and a hard prohibition with a live error code ('never call register_schema for that code ... dual-active corruption'). Alternatives and exclusions are both spelled out.

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