The Tier 2 tools draft table definitions, diagrams and change scripts for you to review. They also store the database connections the Deploy tools use. None of them writes to your schema package.
By the SchemaSmith Team · Last reviewed
Tools that produce new content: table definitions, migration scripts, change analysis.
The Tier 2 tools produce content and hand it back to you: table definitions, a diagram of your data model, or an analysis of a change with the scripts it needs. They do not write to your schema package. Writing is the job of the Modify tools. schemasmith_manage_connection is the one Tier 2 tool that saves anything: it writes a database connection to your settings file, not to the package.
None of these tools asks for confirmation. Over MCP they take no confirm parameter, and on the CLI they run without a prompt. In the REPL, the conversational agent can use them at the default assistant trust level; Trust Levels covers what each level allows.
Over MCP, schemasmith_generate_schema and schemasmith_suggest_changes are in the server's tool list. schemasmith_generate_diagram and schemasmith_manage_connection are not, so an AI assistant reaches them through schemasmith_execute_tool, passing generate_diagram or manage_connection as tool_name. Tool Visibility explains which tools the server lists.
On the CLI, each tool is a subcommand and each parameter an option, both in kebab-case: schemasmith_suggest_changes with default_value becomes ask-forge suggest-changes --default-value. Add --help to any command for its full list of options.
Describe the tables you want, and the tool turns the description into table JSON for your package's platform.
Generates table JSON from a blueprint: a JSON description of the tables you want, their columns, and the relationships between them. An AI assistant builds the blueprint from your plain-language request. The tool picks each platform's data types, adds a primary key, wires the foreign keys, and creates a junction table for each many-to-many relationship. When a template is selected, it follows that template's existing naming conventions. Nothing is written to disk. Inside a schema template, the generated tables carry no schema, so each tenant's schema is resolved at deploy time.
| Parameter | Required | Description |
|---|---|---|
blueprint | Yes | The blueprint, as a JSON string. It has a Name and a list of Tables. Each table has Columns, each with a Name and optionally a Type, Required, Unique, Description and Default, and Relationships, each naming a TargetTable and a Type of one-to-many, many-to-many or one-to-one. Options adds audit or soft-delete columns and sets the primary-key strategy |
platform | No | The platform to generate for. Defaults to the loaded package's platform |
A Type can be a portable type, such as string(200), int or datetime, which the tool maps to each platform's own type. Any other value is passed through as a platform type. This blueprint describes two tables, where each post belongs to an author:
{
"Name": "Blog",
"Tables": [
{ "Name": "Authors",
"Columns": [{ "Name": "DisplayName", "Type": "string(100)",
"Required": true }] },
{ "Name": "Posts",
"Columns": [{ "Name": "Title", "Type": "string(200)", "Required": true },
{ "Name": "PublishedAt", "Type": "datetime" }],
"Relationships": [{ "TargetTable": "Authors", "Type": "one-to-many" }] }
],
"Options": { "IncludeAuditColumns": true }
}
ask-forge generate-schema --blueprint <json>
Generating and writing are two steps by design, so you see what will be created before any file is written. From an AI assistant over MCP:
schemasmith_apply_generated_schema, a Modify tool, which writes one JSON file per table into the template and runs only with confirm: true. Every table is checked before any is written, so one refused table means none are written.For a single table, or a change to a table you already have, use the Modify tools directly: schemasmith_create_table creates a table that follows the template's conventions, and schemasmith_apply_change adds or changes a column, an index, or a key. Both are described under Tables and Columns.
The data model, as text you can paste into a README, a wiki page, or an issue.
Emits the selected template's tables, and the foreign keys between them, as Mermaid or DBML. Mermaid renders in GitHub, GitLab and most wikis with nothing installed. DBML renders at dbdiagram.io and carries more type and index detail. The template scope draws every table and its relationships. The table scope shows one table's columns and keys, and in DBML its indexes, and draws no relationships. Inside a schema template, tables keep the {{SchemaName}} token as written, because the diagram describes the package rather than one tenant's deployment. A table that cannot be read is reported in the output rather than left out. The tool needs a loaded package and a selected template.
| Parameter | Required | Description |
|---|---|---|
scope | No | template, the default, for every table and the foreign keys between them, or table for one table |
table | No | The table to diagram. Required when the scope is table |
format | No | mermaid, the default, or dbml |
ask-forge generate-diagram --format dbml
Before you change a table, check what the change could break.
Analyzes a proposed change and generates the scripts it needs. It covers four kinds of change: making a column NOT NULL (nullability), adding a foreign key (add_fk), changing a column's data type (change_type), and adding a unique constraint (add_unique). It returns a risk level, the issues the change could run into, and suggested actions in priority order. Each action that needs one comes with a script, such as a query that reviews the rows the change affects. In generate or both mode it also returns the migration script for a nullability, foreign-key or type change, such as the UPDATE that replaces NULLs before a column becomes NOT NULL. It works from the package, not the database, so run its review queries against your data to see what they find. In both mode, materialized views (PostgreSQL) and indexed views (SQL Server) that reference the table are flagged too. The tool needs a selected template, and the table must be in it.
| Parameter | Required | Description |
|---|---|---|
change_type | Yes | nullability, add_fk, change_type or add_unique |
table | Yes | The table the change is on |
column | No | The column the change is on. Needed for every change type but add_unique when a migration script is generated |
mode | No | both, the default, for the analysis and the migration script; analyze for the analysis only; generate for the migration script only |
default_value | No | The value NULLs are set to. Needed for a nullability change when a migration script is generated |
ref_table | No | The table a new foreign key references |
ref_column | No | The column a new foreign key references |
new_type | No | The new data type, for a type change |
columns | No | The columns of a new unique constraint, comma-separated |
ask-forge suggest-changes --change-type add_unique --table Users --columns Email
The Deploy tools connect to a database through the connection stored for its platform.
Stores or clears a platform's database connection in the connections section of your settings file, one connection per platform. MariaDB has its own connection, separate from MySQL's. set creates a connection or updates one, so you can give the server first and the database later; the fields you leave out keep their values. clear removes the connection and its stored password. A literal password goes to your operating system's credential store and is never written to the file. On a host with no credential store it is not saved: the connection works for the rest of the session, and the tool says so. A ${ENV_VAR} reference is stored as written and read from the environment each time the connection is used. Connections lists every field.
| Parameter | Required | Description |
|---|---|---|
action | Yes | set or clear |
platform | Yes | SqlServer, PostgreSQL, MySQL or MariaDb |
server | No | The server or host. Needed for a new connection |
port | No | The port, when it is not the platform's default |
database | No | The database |
user | No | The user |
password | No | The password, or a ${ENV_VAR} reference |
connection_properties | No | Extra connection-string properties, as a JSON object |
integrated_security | No | SQL Server only. Use Windows Authentication for this connection, in place of a stored user and password |
ask-forge manage-connection --action set --platform PostgreSQL --server db01
Free schema-as-code for SQL Server, PostgreSQL, MySQL, and MariaDB.
The source is on GitHub for anyone to read.
Get Started on GitHub