The Tier 4 tools run the SchemaSmith Community tools for you: deploy a package, extract a schema or its reference data, or carve a patch. By default a deployment is a dry run; your own settings file can change that.
By the SchemaSmith Team · Last reviewed
The same tools your CI/CD pipeline runs, triggered from a conversation.
The Deploy tools run SchemaQuench, SchemaTongs, DataTongs and SchemaShears as subprocesses. Each one writes the settings file its tool reads, from your parameters and a stored connection, or hands the tool a settings file of your own. It then runs the tool and returns what the tool reported: whether it succeeded, how long it took, and where its logs are.
The tools themselves ship separately, as the SchemaSmith Community tools, and must be installed before you use these. SchemaSmith Community Tools says where Ask Forge looks for them.
A Deploy tool is confirmed before it runs, and a dry run is no exception. Over MCP, every Deploy tool is in the server's tool list, and each call needs confirm: true. On the CLI, each command asks first unless you pass --yes, at every agent.confirmationLevel except never. In the REPL, the conversational agent needs the operator trust level, and it asks before each run while confirmTier4 is on, as it is by default. Confirmation covers each surface.
On the CLI, each tool is a kebab-case subcommand and each parameter a kebab-case option, so dry_run becomes --dry-run. A true-or-false option given on its own means true, and --dry-run false turns the dry run off. Add --help to any command for its full list of options.
A Deploy tool reaches the database in one of two ways:
config_file, the tool builds its settings from the connection stored for the platform: the loaded package's platform, unless you pass platform. Store one with schemasmith_manage_connection, described under Connection Management. MariaDB has its own connection, separate from MySQL's. With no connection stored, the call stops before anything runs and says how to add one.SchemaQuench.settings.json, and the file supplies every setting, its connection included. For SchemaQuench that also means the file decides whether the run is a dry run. Only log_path goes with it, and for SchemaQuench also resume and the switches that say what to run: validate, test_connection, preview_targets, report and what_if_detail. A relative path is found from the working directory schemasmith_navigate_context set, or, when none is set, from the folder Ask Forge started in.Some runs need no connection at all. SchemaShears works from files, and a SchemaQuench validate run or a SchemaTongs write_schemas_only run reads the package from disk.
Bring a target database in line with your package, or check that it can be, without changing anything.
Runs SchemaQuench against the target database. The run is a dry run unless you pass dry_run: false. With config_file, the settings file decides. SchemaQuench works out every change and reports it without applying any. The run deploys exactly the templates it names and touches no other. Each pre-flight switch makes the whole run a check that changes no schema: validate lints the package from disk and needs no connection, test_connection checks the connection to every configured server and the product's MinimumVersion floor, and preview_targets reports each template's targets.
| Parameter | Required | Description |
|---|---|---|
dry_run | No | Preview the changes without applying them. Defaults to true |
templates | No | The templates to deploy, as one name, a comma-separated list or a JSON array. Defaults to the selected template. A name the product's TemplateOrder does not list stops the run |
template | No | An alias for a single name in templates. Giving both is an error |
validate | No | Lint the package from disk and stop. Needs no connection. Combines with none of the switches that run more |
test_connection | No | Check the connection to every configured server and the MinimumVersion floor, and stop |
preview_targets | No | Report each template's deployment targets, with the connection check, and stop |
resume | No | Continue from the last checkpoint instead of starting fresh |
report | No | The base path of a machine-readable report, written as <basepath>.json and <basepath>.md |
what_if_detail | No | concise, normal (the default) or verbose: how much a dry run prints for each script. Console only |
exit_non_zero_on_warning | No | Exit 1 instead of 0 when the run logged a warning |
databases | No | Deploy only to these of the databases the identification scripts discover |
schemas | No | Schema templates only. Deploy only to these of the discovered schemas |
template_targets | No | For each template named, replace the targets its identification script would discover, for this run only |
script_tokens | No | Token values that override the package's, as a JSON object |
prevent_drop | No | Refuse every drop the deployment would make, and report what was held back |
unsupported_feature_policy | No | warn, the default, deploys an object without a feature the target version lacks and records the downgrade; fail stops the run |
online_apply | No | Off (the default), Prefer or Require: whether index and column changes on existing tables use the engine's lower-lock form |
online_apply_max_duration | No | SQL Server 2019 and later. The minutes a new index's online build may run before it pauses as a resumable build |
skip_unchanged_objects | No | Skip view, function, procedure and trigger scripts that have not changed. On by default |
options | No | Advanced settings as a JSON object, such as max_threads, deliver_data and the drop_removed_* flags. The command's help lists every member |
log_hygiene | No | What the logs mask, as a JSON object of ScrubTokens, ScrubPatterns, AllowTokens and LogTokens |
platform | No | The platform, when it is not the loaded package's |
log_path | No | Where the logs go. Defaults to the package's Logs folder |
config_file | No | Run your own settings file, as described under Connections |
ask-forge run-schema-quench --templates Main
Bring an existing database's schema, or its reference data, into a package.
Runs SchemaTongs to extract a live database's schema into package JSON and scripts. It is how you bring an existing database into SchemaSmith, or refresh a package after changes made directly in the database. output_path does not have to exist: extracting into a new folder is the normal way to start, and needs product_name as well. A run that leaves an object out of the package, such as a script that failed validation, finishes as incomplete and names each object it left out.
| Parameter | Required | Description |
|---|---|---|
database | No | The database to extract. Defaults to the stored connection's |
output_path | No | Where the package is written. Defaults to the loaded package, or else the working directory. Created if it does not exist |
product_name | No | The new product's name. Required when extracting into a new folder |
template_name | No | The new template's name. Defaults to the database name |
object_filter | No | Extract only these objects, comma-separated |
exclude_types | No | Skip these object types, comma-separated |
source_schema | No | SQL Server and PostgreSQL. Extract one schema as the body of a schema template |
schema_identification_script | No | SQL Server and PostgreSQL. The discovery query to write into the new Template.json, with source_schema |
write_schemas_only | No | Regenerate the package's .json-schemas validation files and stop. Needs no connection |
folder_mapping | No | Where each object type is written, as a JSON object, for a package whose folders were renamed |
orphan_handling | No | Detect (the default) logs scripts whose objects no longer exist; DetectWithCleanupScripts also writes DROP scripts into the log folder; DetectDeleteAndCleanup also deletes the orphaned files |
validate_scripts | No | Test each extracted script against the source in a rolled-back transaction |
save_invalid_scripts | No | Keep a script that failed that test as a .sqlerror file. On by default |
check_constraint_style | No | SQL Server and PostgreSQL. ColumnLevel or TableLevel; the setting in Product.json wins |
object_order | No | Name (the default) or Physical: how a table's column list is ordered when there is no existing order to keep |
preserve_existing_order | No | Keep an existing file's member order on re-extraction. On by default |
module_syntax | No | SQL Server. CreateOrAlter (the default) or Legacy, for a package that must deploy below SQL Server 2016 SP1 |
script_dynamic_dependency_removal | No | SQL Server. Script the removal of dynamic dependencies before a function is updated |
compat_encoding | No | auto (the default), legacy or modern. Only for a version-detection problem |
exit_non_zero_on_warning | No | Exit 1 instead of 0 when the run logged a warning |
log_hygiene | No | What the logs mask, as for SchemaQuench |
platform | No | The platform, when it is not the loaded package's |
log_path | No | Where the logs go. Defaults to the Logs folder under the output path |
config_file | No | Run your own settings file |
ask-forge run-schema-tongs --output-path ./Shop --product-name Shop
Runs DataTongs to extract table data into content files and MERGE scripts, so the package can deliver that reference data at deployment. With configure_data_delivery, it then sets up data delivery on each table's JSON after the extraction. An option you leave out takes DataTongs' own default, so a run writes .tabledata content files and merge scripts that refer to them by token. A run that skips a table, a column or a script finishes as incomplete and names what it skipped.
| Parameter | Required | Description |
|---|---|---|
tables | No | The tables to extract, as a JSON array. Each entry needs a name, and can add keyColumns, selectColumns, filter and mergeType. Required unless you use config_file |
database | No | The database to extract from. Defaults to the stored connection's |
script_path | No | Where the MERGE scripts go. Defaults to the loaded product's folder, or else the working directory; created if missing |
content_path | No | Where the content files go. Defaults to the loaded product's folder, or else the working directory; created if missing |
configure_data_delivery | No | Set up data delivery on each table's JSON after the extraction |
template_path | No | The template that setup writes to, when the content lands outside the template |
merge_type | No | The run's default merge type: Insert, Insert/Update or Insert/Update/Delete. A table's own mergeType wins |
delivery_encoding | No | Json (the default) or Xml. It must match the encoding the table's data delivery declares |
source_schema | No | SQL Server and PostgreSQL. Extract from one schema |
options | No | Advanced settings as a JSON object, such as output_content_files, tokenize_scripts and disable_triggers |
compat_encoding | No | auto (the default), legacy or modern. Only for a version-detection problem |
exit_non_zero_on_warning | No | Exit 1 instead of 0 when the run logged a warning |
log_hygiene | No | What the logs mask, as for SchemaQuench |
platform | No | The platform, when it is not the loaded package's |
log_path | No | Where the logs go. Defaults to the Logs folder under the script path |
config_file | No | Run your own settings file |
ask-forge run-data-tongs --tables <json> --configure-data-delivery
Deliver only the objects that changed, rather than the whole product.
Runs SchemaShears to carve a patch package out of a full product: only the files a manifest or an always_include file lists, plus the Product.json and Template.json files they need. SchemaShears works from files, so it needs no connection. By default the patch turns off every drop, so nothing missing from the patch is dropped from the target; allow_drops turns chosen categories back on. It writes patch-build-report.txt into the patch, listing every file it included and why. Review the report, preview the patch with a schemasmith_run_schema_quench dry run, and then deploy it: it updates the objects in the patch and leaves every other object in place.
| Parameter | Required | Description |
|---|---|---|
manifest | No | A file listing the product-relative paths to include, one per line, such as a list of changed files from source control. Required unless you use config_file |
output | No | The folder the patch is written to. It must be empty or not exist yet. Required unless you use config_file |
source | No | The product to carve from. Defaults to the loaded product, and must already exist |
always_include | No | A file listing paths to include whatever the manifest says |
zip | No | Also write the patch as <output>.zip |
allow_drops | No | The drop categories to leave on, comma-separated, such as Columns,Indexes |
exit_non_zero_on_warning | No | Exit 1 instead of 0 when the build logged a warning |
log_hygiene | No | What the logs mask, as for SchemaQuench |
log_path | No | Where the logs go. Defaults to a temporary folder; one you give must not be inside the output folder |
config_file | No | Run your own settings file. Only log_path combines with it |
ask-forge run-schema-shears --manifest changed.txt --output patch --zip
The result of each run reports the exit code its tool returned:
| Exit code | What it means |
|---|---|
0 |
Success. |
1 |
Finished but incomplete, which is neither a success nor a failure. SchemaQuench downgraded a feature the target lacks, SchemaTongs left an object out of the package, or DataTongs skipped a table, a column or a script. With exit_non_zero_on_warning on, any of these tools also returns 1 for a logged warning. The result names each thing left out or downgraded. |
2 |
A failure you can fix: a setting, the package, the target, or a refused step. The tool's output and error log say which. |
3 |
A defect in the tool itself, not something the settings or the package caused. It is worth reporting, with the error log. |
The result of a failed run quotes the end of the tool's output and names the full progress log, which schemasmith_view_log can show.
In the MCP server, cancelling a run from your client stops the tool and every process it started. Shutting the server down does the same, and so does your client closing the server's input, after which the server exits. A call that the cancel stopped gets no reply, as the MCP specification asks, and what it would have said goes to the server's log. A call whose tool had already finished when the cancel arrived is answered with its result.
Because closing the server's input is how a client shuts the server down, keep the input open until you have your answers: closing it cancels every call still running.
From an AI assistant over MCP, a deployment follows four steps:
confirm: true and leaves dry_run at its default, so SchemaQuench reports every change it would make without making any.dry_run: false and confirm: true.From the command line, the same preview and apply, with your package's path:
# Preview: a dry run is the default
ask-forge --product C:\src\my-product run-schema-quench --templates Main
# Apply
ask-forge --product C:\src\my-product run-schema-quench --templates Main `
--dry-run false
# Preview: a dry run is the default
ask-forge --product /src/my-product run-schema-quench --templates Main
# Apply
ask-forge --product /src/my-product run-schema-quench --templates Main \
--dry-run false
Each command asks you to confirm before it runs, unless agent.confirmationLevel is never. In a script, where no one is there to answer, --yes answers for you.
Free schema-as-code for SQL Server, PostgreSQL, MySQL, and MariaDB.
The source is on GitHub for anyone to read.
Get Started on GitHub