Skip to main content
Glama

Create database sync

create_database_sync
Destructive

Register a saved schema for relational synchronization to PostgreSQL or SQL Server. Requires owner and a sync-enabled plan. Starts a billed classification job when available; returns database ID, classification_job_id or classification_skipped, stamped_keys and registration_notices. The webhook signing secret stays outside the MCP response and can be managed in the web app. The schema is initially unpublished: wait for classification, review keys/options/notices, then publish_schema before any data can sync. pk_strategy locks once the physical model ships. Owned child arrays replace previous membership, so omitted children are deleted on re-enrichment. purge_entity_state transfers custody to replicas; relay custody_warning. A connected host may provision automatically; otherwise get_database_setup_instructions starts browser-confirmed client pairing. Modeling, publication and delivery: enricher://docs/database-sync.

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": {
      "schema_id": "<schema_id>",
      "name": "<name>"
    },
    "name": "create_database_sync"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesName of the physical database (existing on the user's server, or created by `ee-database run --create-missing`); shared by every schema linked to this database sync. Also used (snake-cased) as the conventional replica database name by the ee-database CLI.
dialectNoTarget database type: `postgres` (PostgreSQL) or `sqlserver` (SQL Server 2022 or later). The snapshot and the deltas are rendered in its SQL.postgres
on_gapsNoAdmission gate — what is written when an enrichment has gaps (non-nullable fields unfilled). 'reject_entity': nothing — one gap anywhere refuses the whole enrichment. 'skip_children' (default): the entity without its incomplete children — an array item is dropped, a shared 1-1 reference is detached (child not written, parent's foreign key NULL); gaps with no such child above them still reject. 'accept_partial': everything — gaps land as NULLs, and under last-write-wins a later partial run erases what an earlier one filled.skip_children
schema_idYesSaved schema UUID to connect the database to.
pk_strategyNosurrogate (default): physical surrogate IDs with unique schema keys; natural: use schema keys as physical primary keys, so a later re-key also rewrites their copies in every dependent table. Locks once the physical model ships; decide before publication. See enricher://docs/database-sync.surrogate
target_hostNoSync host (id or name) that should provision and sync this registration automatically (managed ee-database mode). Omitted: auto-assigned when exactly one eligible host is connected; otherwise the response's connected_hosts lists the candidates — relay the choice to the user and call assign_sync_host, or fall back to get_database_setup_instructions for browser-confirmed manual pairing.
key_languageNoLanguage of multilingual identity tokens (ISO 639-1), shared by all schemas of this database. Usually defaults to schema language when needed; publication may request it after classification. Locked once chosen for the database.
purge_on_ackNoDelete delivered delta copies once acknowledged.
index_scalarsNonone: identity/feed indexes; keys: add natural keys and relation access paths; filterable (default): add dates, search intent, spatial/range roles and entity query indexes; all: every scalar. Later changes queue index migrations.filterable
notify_debounce_sNoQuiet period (seconds) before a delta-available notification fires: each new delta resets the timer, so a burst is announced once. Default 5 for MCP callers (agent workflows expect near-immediate reaction); the web app defaults to 30 to coalesce human-scale editing bursts.
propagate_not_nullNoMirror required schema fields as SQL NOT NULL. Omitted: on for strict gap policies, off for accept_partial. True with accept_partial is refused. Later tightening requires validating existing replica rows; violations can quarantine the migration.
purge_entity_stateNoDelete fully delivered entity state after every linked database acknowledges it. Transfers custody to replicas, makes server snapshots incomplete and limits duplicate checks. Relay custody_warning and obtain agreement before enabling. Default false.
use_platform_modelsNoBy default (false) the registration's classification pass runs on YOUR model: its calls come back as pending requests on classification_job_id, to answer with answer_llm_request; no credits are consumed. true runs it on the platform (billed). Protocol: enricher://docs/llm-delegation.
purge_on_ack_delay_daysNoGrace period for purge_on_ack: keep acknowledged delta copies this many days (from acknowledgement) before the hourly purge deletes them. Omit to delete them at acknowledgement. Bounded by the plan's delta retention ceiling.
pattern_index_localized_keysNoAdd per-language pattern-match indexes on indexed localized keys/labels (default false). Useful for prefix autocomplete; increases write/index cost. PostgreSQL only: refused (option_not_served) with dialect `sqlserver`.
purge_entity_state_delay_daysNoGrace period for purge_entity_state: a fully-delivered entity row is kept until it has gone this many days without an update, then the hourly purge deletes it. Omit to delete it as soon as every database of the schema acknowledged it.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / dialect / description
      Previous value: -"SQL dialect the deltas are rendered in: postgres | mysql | sqlite."New value: +"Target database type: `postgres` (PostgreSQL) or `sqlserver` (SQL Server 2022 or later). The snapshot and the deltas are rendered in its SQL."
    • addedInput schema / properties / dialect / enum
      Added value: +[
      +  "postgres",
      +  "sqlserver"
      +]
    • changedInput schema / properties / pattern_index_localized_keys / description
      Previous value: -"Add per-language pattern-match indexes on indexed localized keys/labels (default false). Useful for prefix autocomplete; increases write/index cost. Concrete SQL depends on the selected dialect."New value: +"Add per-language pattern-match indexes on indexed localized keys/labels (default false). Useful for prefix autocomplete; increases write/index cost. PostgreSQL only: refused (option_not_served) with dialect `sqlserver`."
    • changedInput schema / properties / pk_strategy / description
      Previous value: -"surrogate (default): physical surrogate IDs with unique schema keys; natural: use schema keys as physical primary keys and restrict later re-keying. Locks once the physical model ships; decide before publication. See enricher://docs/database-sync."New value: +"surrogate (default): physical surrogate IDs with unique schema keys; natural: use schema keys as physical primary keys, so a later re-key also rewrites their copies in every dependent table. Locks once the physical model ships; decide before publication. See enricher://docs/database-sync."
  2. Changed2 schema fields changed
    • removedInput schema / properties / delegate_llm_calls
      Removed value: -{
      -  "default": false,
      -  "description": "Run the registration's classification pass on YOUR model: its calls come back as pending requests on classification_job_id, to answer with answer_llm_request; no credits are consumed. Plan feature. Protocol: enricher://docs/llm-delegation.",
      -  "title": "Delegate Llm Calls",
      -  "type": "boolean"
      -}
    • addedInput schema / properties / use_platform_models
      Added value: +{
      +  "default": false,
      +  "description": "By default (false) the registration's classification pass runs on YOUR model: its calls come back as pending requests on classification_job_id, to answer with answer_llm_request; no credits are consumed. true runs it on the platform (billed). Protocol: enricher://docs/llm-delegation.",
      +  "title": "Use Platform Models",
      +  "type": "boolean"
      +}
  3. Changed1 schema field changed
    • addedInput schema / properties / delegate_llm_calls
      Added value: +{
      +  "default": false,
      +  "description": "Run the registration's classification pass on YOUR model: its calls come back as pending requests on classification_job_id, to answer with answer_llm_request; no credits are consumed. Plan feature. Protocol: enricher://docs/llm-delegation.",
      +  "title": "Delegate Llm Calls",
      +  "type": "boolean"
      +}
  4. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Goes well beyond the annotations: discloses that classification is billed unless use_platform_models is set, that pk_strategy locks once the physical model ships, that omitted owned child arrays are deleted on re-enrichment, that purge_entity_state transfers custody and requires relaying custody_warning, and that the webhook signing secret is deliberately withheld from the response. These are exactly the destructive and irreversible consequences an agent needs before calling a destructiveHint 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?

Front-loads the core action and prerequisites, then runs through lifecycle, returns, and side effects in compact sentences. It is dense and mostly earns its length, though the webhook-secret sentence is peripheral and the final docs pointer adds bulk.

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 16-parameter, open-world, destructive registration tool it covers prerequisites, the post-call workflow, returned fields (database ID, classification_job_id/classification_skipped, stamped_keys, notices), and the publication gate. Output shape is covered by the output schema, so the remaining gap is minor.

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 already 100%, so the schema carries most parameter meaning. The description adds cross-parameter behavior the schema can't express, notably the locked-forever semantics of pk_strategy, the custody transfer implied by purge_entity_state, and the child-replacement rule for omitted arrays.

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?

Names a specific verb and resource ('Register a saved schema for relational synchronization') plus the target dialects, so the agent can tell it creates a database-sync registration rather than a schema or a one-off record sync. It does not explicitly contrast itself with siblings like sync_records_to_database or list_database_syncs, so sibling differentiation is implied by the resource rather than stated.

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?

States prerequisites explicitly (owner role, sync-enabled plan) and lays out a sequence of alternatives: wait for classification, then publish_schema before data can sync; use target_host for auto-provision, otherwise call assign_sync_host with a connected host or fall back to get_database_setup_instructions. The agent is told which sibling to call and under what condition.

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.