Change files in your local schema package — edit tables, columns, indexes, packages, and configuration — with every operation gated behind explicit confirmation.
By the SchemaSmith Team · Last reviewed
Tools that create or change files in your schema package.
Ask Forge's 13 Tier 3 (Modification) tools create and change files in your local schema package — applying edits, renaming objects, creating tables and views, building packages, and managing configuration. They change files on disk only; they never connect to a live database (that is Tier 4).
Every operation is confirmation-gated. Through the MCP server, each call must pass confirm: true; in the CLI agent the confirmTier3 setting governs the prompt, and you can pass --yes to approve scripted runs.
Modification tools require the Operator trust level — the only level that unlocks them — and include every Tier 1 and Tier 2 capability.
Apply table and column changes, create new tables, and rename objects with cascade across dependent indexes, keys, and constraints.
apply-change
MCP: schemasmith_apply_change
The general-purpose edit tool: add, modify, or remove a column, index, foreign key, check constraint, statistic, or full-text index on one table. Requires a selected template.
Parameters: --change-type (required) — one of add_column, modify_column, remove_column, add_index, modify_index, remove_index, add_fk, modify_fk, remove_fk, add_check, modify_check, remove_check, add_statistic, modify_statistic, remove_statistic, set_fulltext, remove_fulltext. --table (required) — Target table. --definition (required) — JSON definition of the change.
Example:
ask-forge apply-change --change-type add_column \
--table Person.Person \
--definition '{"Name":"MiddleName","DataType":"nvarchar(50)","IsNullable":true}'
create-table
MCP: schemasmith_create_table
Create a new table JSON file with platform-correct identifier wrapping, an auto-generated identity primary key (unless you mark one), and conventions detected from existing tables. Requires a selected template.
Parameters: --table (required) — Bare table name. --schema (optional) — Schema name; defaults to the platform default (dbo, public, or the database name). --columns (optional) — JSON array of column definitions (name, type, nullable, pk).
Example:
ask-forge create-table --table ProductReview --schema Production \
--columns '[{"name":"Rating","type":"int","nullable":false},
{"name":"Comment","type":"nvarchar(500)"}]'
rename-table
MCP: schemasmith_rename_table
Rename a table: sets OldName for deployment tracking, renames the file, and auto-cascades cross-table foreign-key references. Dependent object names and script references are reported as suggestions, not auto-applied.
Parameters: --table (required) — Current table name. --new-name (required) — New table name (must differ).
Example:
ask-forge rename-table --table Sales.Customer --new-name Client
rename-column
MCP: schemasmith_rename_column
Rename a column with full cascade through that table's indexes, foreign keys, check expressions, statistics, and full-text columns — plus cross-table FK references that point at it. Sets OldName for deployment tracking; script references are reported, not rewritten.
Parameters: --table (required) — Target table. --column (required) — Current column name. --new-name (required) — New column name (must differ).
Example:
ask-forge rename-column --table Person.EmailAddress \
--column EmailAddress --new-name PrimaryEmail
Write AI-generated table definitions, SQL scripts, and migration plans into your schema package.
apply-generated-schema
MCP: schemasmith_apply_generated_schema
Write the output of the Tier 2 generate-schema tool to disk, saving each table as {schema}.{table}.json in the template's Tables directory. Bridges generation and modification — generate, review, then apply.
Parameters: --schema (required) — GeneratedSchema JSON from generate-schema. --product-path (optional) — Target product directory (defaults to context). --template (optional) — Target template (defaults to context).
Example:
ask-forge apply-generated-schema --schema @generated.json \
--template AdventureWorks
save-script
MCP: schemasmith_save_script
Write a .sql file into an existing, registered script folder of the loaded product. Appends .sql if missing, and refuses to overwrite unless you opt in. Requires a loaded product.
Parameters: --content (required) — SQL script body. --folder (required) — Name of an existing script folder. --filename (required) — Output filename. --overwrite (optional) — Replace an existing file (default false).
Example:
ask-forge save-script --folder Migrations \
--filename BackfillCustomerStatus.sql \
--content "UPDATE Sales.Customer SET Status='Active' WHERE Status IS NULL;"
save-migration
MCP: schemasmith_save_migration
Write a migration plan (the output of the Tier 1 plan-migration tool) to disk as a plan.md summary, a combined migration.sql, and one step-NN-<desc>.sql per step.
Parameters: --plan (required) — Migration plan JSON from plan-migration. --output-path (optional) — Output directory (default: Migrations/<timestamp> under the product path).
Example:
ask-forge save-migration --plan @plan.json \
--output-path ./Migrations/v2-upgrade
Configure how reference data is merged into a table during deployment.
configure-data-delivery
MCP: schemasmith_configure_data_delivery
Set DataTongs merge properties on a table's JSON — merge type, match columns, filter, trigger handling, and content file. For upsert merge types it derives match columns from the primary key when you don't supply them. Requires a selected template.
Parameters: --table (required) — Target table. --merge-type (required) — None, Insert, Insert/Update, or Insert/Update/Delete. --match-columns (required for upserts without a primary key) — Comma-separated key columns. --merge-filter (optional) — SQL WHERE clause. --disable-triggers (optional). --content-file (optional) — Data file relative to the Table Data folder.
Example:
ask-forge configure-data-delivery --table Production.UnitMeasure \
--merge-type "Insert/Update" --match-columns UnitMeasureCode \
--content-file UnitMeasure.json
Build deployment packages, add script folders, and manage the script tokens substituted during deployment.
create-package
MCP: schemasmith_create_package
Zip a deployable package from the loaded product — Product.json, the selected (or all) templates, and, by default, every registered script folder. Confirms before overwriting an existing zip. Requires a loaded product.
Parameters: --name (required) — Package name (without .zip). --output-path (optional) — Output directory (default: product root). --include-scripts (optional) — Include script folders (default true). --template (optional) — Single template to package (default: all).
Example:
ask-forge create-package --name AdventureWorks-Release \
--template AdventureWorks
add-folder
MCP: schemasmith_add_folder
Create a script folder and register it in Product.json or Template.json with a deployment slot — inferred from the folder name when not given (for example, Procedures → Objects). With --parent, creates a subfolder that inherits the parent's slot. Requires a loaded product.
Parameters: --folder (required) — Folder name to create. --parent (optional) — Parent folder (creates a subfolder). --quench-slot (optional) — Deployment slot (Before, Objects, BetweenTablesAndKeys, AfterTablesScripts, AfterTablesObjects, TableData, After); inferred if omitted. --level (optional) — product or template.
Example:
ask-forge add-folder --folder Procedures \
--quench-slot Objects --level template
manage-tokens
MCP: schemasmith_manage_tokens
Manage and analyze the {{Token}} placeholders substituted during deployment: list, add, update, remove, scan for usage, or suggest tokenization. Supports special token types via value prefixes such as <*Query*> and <*File*>. Requires a loaded product.
Parameters: --action (required) — list, add, update, remove, scan, or suggest. --level (required for add/update/remove) — product or template. --token-name (required for add/update/remove and token scans) — Name without {{ }}. --token-value (required for add/update). --scan-mode (optional) — token or orphans.
Example:
ask-forge manage-tokens --action add --level product \
--token-name AdventureWorksDb --token-value AdventureWorks
Create platform-optimized views. These tools are gated by the loaded product's platform — each returns an error if the active platform doesn't match.
create-materialized-view
MCP: schemasmith_create_materialized_view
Create a new materialized-view JSON file in the template's Materialized Views directory (requires a PostgreSQL product). Errors if the view already exists.
Parameters: --name (required) — Bare view name. --definition (required) — SQL SELECT that defines the view. --schema (optional, default public). --with-data (optional) — Populate on creation (default true). --tablespace (optional). --access-method (optional).
Example:
ask-forge create-materialized-view --name mv_sales_by_region \
--schema analytics \
--definition "SELECT region, SUM(total) AS total FROM sales.order GROUP BY region"
create-indexed-view
MCP: schemasmith_create_indexed_view
Create a new indexed-view JSON file in the template's Indexed Views directory (requires a SQL Server product). The definition should use WITH SCHEMABINDING. Errors if the view already exists.
Parameters: --name (required) — Bare view name. --definition (required) — SQL query defining the view. --schema (optional, default dbo).
Example:
ask-forge create-indexed-view --name vSalesByTerritory --schema Sales \
--definition "SELECT TerritoryID, COUNT_BIG(*) AS Cnt
FROM Sales.SalesOrderHeader GROUP BY TerritoryID"