9 tools for migration scripts, schema generation, file output, and configuration management.
Ask Forge generation tools use AI to create new content based on your schema. They produce migration scripts, schema designs, change suggestions, and configuration updates — all presented for your review before any action is taken.
Generated content is never applied automatically. Scripts and plans are output as text or saved to files you specify. This keeps you in full control while benefiting from AI-powered analysis.
Generation tools require the Assistant trust level or higher. They build on the read-only capabilities of Tier 1. None of these tools require confirmation — they are available immediately at the Assistant trust level.
All 9 tools use the forge_ prefix when accessed through the MCP server (e.g., forge_generate_migration). In the CLI and REPL, use kebab-case (e.g., generate-migration).
Generate migration scripts and analyze the impact of proposed schema changes.
generate-migration
MCP: forge_generate_migration
Generate a SQL migration script for a schema change — nullability fixes, foreign key additions, or data type changes. Requires an active template context. The tool validates that the target table and column exist in the current template before generating the script.
| Parameter | Required | Description |
|---|---|---|
--change-type | Yes | Type of change: nullability, add_fk, or change_type |
--table | Yes | Target table name |
--column | Yes | Target column name |
--default-value | No | Default value for NULL cleanup (required for nullability changes) |
--ref-table | No | Referenced table (required for add_fk) |
--ref-column | No | Referenced column (required for add_fk) |
--new-type | No | New data type (required for change_type) |
Example:
ask-forge generate-migration --change-type nullability --table Customers \
--column Email --default-value "unknown@example.com"
Returns: Platform-specific SQL migration script (T-SQL, PL/pgSQL, or MySQL dialect) with proper dependency ordering.
suggest-changes
MCP: forge_suggest_changes
Analyze a proposed schema change and get recommendations, risk assessment, and migration scripts. Requires an active template context. Returns a risk level (Low, Medium, High, Critical), potential issues, suggested actions with priority ordering, and Forge's assessment.
| Parameter | Required | Description |
|---|---|---|
--change-type | Yes | Type of change: nullability, add_fk, change_type, or add_unique |
--table | Yes | Table name |
--column | No | Column name (required for most changes) |
--ref-table | No | Referenced table (for add_fk) |
--ref-column | No | Referenced column (for add_fk) |
--new-type | No | New data type (for change_type) |
--columns | No | Comma-separated column names (for add_unique) |
Example:
ask-forge suggest-changes --change-type add_unique --table Users \
--columns "Email,TenantID"
Returns: Risk level, potential issues, prioritized suggested actions, and Forge's assessment of the change.
Generate SchemaSmith-format JSON schema definitions from blueprint specifications.
generate-schema
MCP: forge_generate_schema
Generate platform-specific table JSON from a SchemaBlueprint specification. Accepts a JSON blueprint describing the desired schema and produces table definitions for the target platform. If a template context is active, the tool detects existing conventions (naming, data types) and applies them to the generated output.
Use apply-generated-schema (Tier 3) to write the results to disk.
| Parameter | Required | Description |
|---|---|---|
--blueprint | Yes | JSON string containing SchemaBlueprint spec with name, tables, columns, relationships, and options |
--platform | No | Override platform (MSSQL, PostgreSQL, MySQL). Defaults to current context platform |
Example:
ask-forge generate-schema \
--blueprint '{"name":"Inventory","tables":[{"name":"Warehouses",
"columns":[{"name":"ID","type":"int","primaryKey":true},
{"name":"Name","type":"string","maxLength":100}]}]}'
Returns: Complete SchemaSmith JSON schema with packages, templates, tables, columns, indexes, and relationships.
Save generated scripts and migration plans to the file system.
save-script
MCP: forge_save_script
Save a SQL script to a script folder in the current product or template. Requires an active product context. The script folder must already exist in the product or template definition. If the filename does not end with .sql, the extension is appended automatically.
| Parameter | Required | Description |
|---|---|---|
--content | Yes | SQL script content to save |
--folder | Yes | Script folder name (e.g., Migrations, Before) |
--filename | Yes | Script filename (e.g., UpdateCustomerEmail.sql) |
--overwrite | No | Whether to overwrite if file exists (default: false) |
Example:
ask-forge save-script --folder Migrations \
--filename "AddIndexOnEmail.sql" \
--content "CREATE INDEX IX_Users_Email ON Users(Email);"
Returns: Confirmation with the file path and size of the saved script.
save-migration
MCP: forge_save_migration
Save a migration plan to disk as a markdown summary and individual SQL script files. Takes a migration plan JSON (typically from the plan-migration read-only tool) and writes a plan.md summary, a combined migration.sql script, and individual step-NN-<description>.sql files for each step.
| Parameter | Required | Description |
|---|---|---|
--plan | Yes | Migration plan JSON (from plan_migration tool output) |
--output-path | No | Custom output directory (default: Migrations/<timestamp> under product path) |
Example:
ask-forge save-migration --plan '<migration-plan-json>' \
--output-path ./migrations/v2-upgrade
Returns: Confirmation with directory path, file list, and total size of saved migration artifacts.
Manage database connections and SchemaSmith tool paths stored in the config file. Environment variables and explicit CLI parameters take precedence over stored values.
set-connection
MCP: forge_set_connection
Set or update the database connection for a platform. Each platform (mssql, postgresql, mysql) has one connection with individual fields. Properties can be set or updated incrementally — existing fields are preserved when updating.
| Parameter | Required | Description |
|---|---|---|
--platform | Yes | Database platform: mssql, postgresql, or mysql |
--server | No | Server/host (required when creating a new connection) |
--port | No | Port number (defaults: MSSQL 1433, PostgreSQL 5432, MySQL 3306) |
--database | No | Database name |
--user | No | User ID |
--password | No | Password |
Example:
ask-forge set-connection --platform postgresql --server localhost \
--port 5432 --database myapp --user postgres --password secret
Returns: Confirmation with the updated connection settings for the specified platform.
set-tool-path
MCP: forge_set_tool_path
Set the path to a SchemaSmith tool (SchemaTongs, DataTongs, or Quench) for a platform. The path can be a full filesystem path, a bare executable name resolved via PATH, or a path containing environment variables (%PROGRAMFILES%, ${HOME}). Variable references are stored as-is and expanded at runtime.
| Parameter | Required | Description |
|---|---|---|
--platform | Yes | Database platform: mssql, postgresql, or mysql |
--tool | Yes | Tool name: schemaTongs, dataTongs, or quench |
--path | Yes | Path to the tool executable |
Example:
ask-forge set-tool-path --platform postgresql --tool quench \
--path postgres-quench
Returns: Confirmation with the stored tool path for the specified platform and tool.
clear-connection
MCP: forge_clear_connection
Remove the database connection for a platform. Deletes all stored connection fields for the specified platform from the configuration file.
| Parameter | Required | Description |
|---|---|---|
--platform | Yes | Database platform to clear: mssql, postgresql, or mysql |
Example:
ask-forge clear-connection --platform postgresql
Returns: Confirmation that the connection was removed.
clear-tool-path
MCP: forge_clear_tool_path
Remove a tool path configuration for a platform. After clearing, the tool will need to be found via PATH or environment variables at runtime.
| Parameter | Required | Description |
|---|---|---|
--platform | Yes | Database platform: mssql, postgresql, or mysql |
--tool | Yes | Tool name to clear: schemaTongs, dataTongs, or quench |
Example:
ask-forge clear-tool-path --platform mssql --tool schemaTongs
Returns: Confirmation that the tool path was removed.