Tier 1 is the read-only tier. It holds the tools that explore and analyze your schema package, search the knowledge base and tool logs, and find and run other tools.
By the SchemaSmith Team · Last reviewed
Scan your template and discover what conventions are actually in use — not what someone wrote in a wiki three years ago.
Tier 1 is ReadOnly: its tools read, browse, analyze and review. A Tier 1 tool never requires confirmation, and every trust level includes Tier 1. The one tool that can run something more, schemasmith_execute_tool, takes its confirmation from the tool it runs. Trust Levels sets out all four tiers.
This page follows the capability groups of the tools reference: Explore, the Tier 1 tools of Analyze, Learn, and Discover. The one Analyze tool outside Tier 1, schemasmith_suggest_changes, is a Tier 2 tool, covered in Generation Tools.
A few of these tools work on one engine only. Each says which, and Platform-Specific Objects covers the engine-specific tools engine by engine.
In the MCP server, every tool uses the schemasmith_ prefix, and the headings on this page give each tool's MCP name. In the ask-forge CLI, each tool is a kebab-case subcommand, and each parameter is an option of the same name in kebab-case: source_ref becomes --source-ref.
The CLI examples assume a product and a template are selected. Give --product and --template on the command, or select them once with ask-forge navigate-context; later subcommands use the same selection.
Over MCP, the server lists a curated set of tools directly. The others are reached through schemasmith_execute_tool, with the tool's name without the prefix as tool_name. Tool Visibility explains the split, and this table shows where each Tier 1 tool sits:
| Tool | Group | Over MCP |
|---|---|---|
schemasmith_show_context | Explore | In the tool list |
schemasmith_navigate_context | Explore | In the tool list |
schemasmith_list_templates | Explore | Through schemasmith_execute_tool |
schemasmith_list_tables | Explore | In the tool list |
schemasmith_show_table | Explore | In the tool list |
schemasmith_diff_tables | Explore | Through schemasmith_execute_tool |
schemasmith_list_folders | Explore | Through schemasmith_execute_tool |
schemasmith_list_scripts | Explore | Through schemasmith_execute_tool |
schemasmith_list_connections | Explore | Through schemasmith_execute_tool |
schemasmith_show_config | Explore | Through schemasmith_execute_tool |
schemasmith_show_platform_capabilities | Explore | Through schemasmith_execute_tool |
schemasmith_audit_version_floor | Explore | Through schemasmith_execute_tool |
schemasmith_list_materialized_views | Explore | Through schemasmith_execute_tool |
schemasmith_show_materialized_view | Explore | Through schemasmith_execute_tool |
schemasmith_diff_materialized_views | Explore | Through schemasmith_execute_tool |
schemasmith_list_indexed_views | Explore | Through schemasmith_execute_tool |
schemasmith_show_indexed_view | Explore | Through schemasmith_execute_tool |
schemasmith_diff_indexed_views | Explore | Through schemasmith_execute_tool |
schemasmith_review_schema | Analyze | In the tool list |
schemasmith_dependencies | Analyze | In the tool list |
schemasmith_plan_migration | Analyze | In the tool list |
schemasmith_check_data | Analyze | Through schemasmith_execute_tool |
schemasmith_validate_json | Analyze | In the tool list |
schemasmith_search_schemas | Analyze | In the tool list |
schemasmith_show_conventions | Analyze | Through schemasmith_execute_tool |
schemasmith_search_knowledge | Learn | In the tool list |
schemasmith_view_log | Learn | Through schemasmith_execute_tool |
schemasmith_discover_tools | Discover | In the tool list |
schemasmith_execute_tool | Discover | In the tool list |
Tools for browsing and inspecting your schema package. All read-only, so running them never changes your schema package.
Shows where you are: the current product, platform, selected template, and active table. Start here in any conversation. It takes no parameters.
ask-forge show-context
Switches between products, templates, and tables. It sets the working context that other tools run against.
| Parameter | Required | Description |
|---|---|---|
product | No | Path to the product directory to load |
template | No | Template name to select |
table | No | Table name to focus on |
working_directory | No | Sets where file operations resolve when no product is loaded. Useful before a first extraction, when there is no product to anchor paths to yet. |
clear | No | Clears the current context, so the next product is loaded fresh |
ask-forge navigate-context --product my-product --template Main
Lists every template in the current product. It takes no parameters.
ask-forge list-templates
Lists every table in the current template. With verbose: true, it adds column counts and key information for each table.
| Parameter | Required | Description |
|---|---|---|
verbose | No | Include column counts and key information (default false) |
ask-forge list-tables --verbose
Shows one table's full structure: every column with its data type and nullability, the primary key, all foreign keys with column mappings, indexes, check constraints, and a MySQL or MariaDB table's partitioning. Start here to understand any table.
| Parameter | Required | Description |
|---|---|---|
table | No | The table to show; optional if a table is already selected in context |
ask-forge show-table --table Customers
Compares two table definitions side by side. It reports added, removed, and changed columns, keys, and indexes.
| Parameter | Required | Description |
|---|---|---|
table1 | Yes | First table name |
table2 | Yes | Second table name |
ask-forge diff-tables --table1 Customers --table2 Suppliers
Lists the script folders of the product and the current template, with their quench slot assignments and script counts. A template that declares no folders lists the engine's default set for its platform and kind, because that is what SchemaQuench deploys. It takes no parameters.
ask-forge list-folders
Lists the scripts in one folder. Useful for reviewing migration scripts or object definitions.
| Parameter | Required | Description |
|---|---|---|
folder | Yes | Name of the script folder to list |
ask-forge list-scripts --folder Procedures
Lists all configured database connections. Passwords and secret-looking connection properties are masked.
| Parameter | Required | Description |
|---|---|---|
platform | No | One platform's connection; defaults to the context's platform, or every connection when there is none |
ask-forge list-connections --platform PostgreSQL
Display the configured database connections. Secret-looking values are masked: passwords, API keys, tokens, credentials and connection strings alike, and a password embedded in a connection string is redacted too.
| Parameter | Required | Description |
|---|---|---|
section | No | connections or all (default) |
ask-forge show-config --section connections
Reports what the current platform supports: naming rules, identifier quoting, feature flags, and version-specific capabilities. It reports two separate things, which are easy to confuse: Feature Support, whether the engine has a feature at all, at any version, and Version Floor Impact, which features the engine has but degrades below your product's MinimumVersion.
The floor is read from the product in context. Ask about a different platform than your product's and the report falls back to that platform's assumed minimum instead. Platform-Specific Objects shows what it reports for each engine.
| Parameter | Required | Description |
|---|---|---|
platform | No | The platform to report on; defaults to the context's platform |
ask-forge show-platform-capabilities --platform PostgreSQL
Finds every place the selected template uses a feature that needs a newer engine than the product's MinimumVersion, and what the engine does with each one below that floor. Where schemasmith_show_platform_capabilities answers "what does this floor cost me in principle", this answers "what does it cost me here". A template that uses none of the above-floor features gets a clean report; one that does gets locations: table, object, and whether the usage is gated by an Apply Condition.
It scans the template's tables, the indexes of its indexed views (SQL Server) and materialized views (PostgreSQL), and its sequences (PostgreSQL and MariaDB). It reports, never refuses. Authoring above the floor is supported: at deploy time the engine degrades almost every such feature rather than rejecting the package, and the few it cannot degrade safely stop the deployment instead. Tables, views and sequences that cannot be read are reported rather than skipped, so an incomplete audit never presents itself as a clean one.
ask-forge audit-version-floor
PostgreSQL only. Lists every materialized view in the current template. With verbose: true, it adds each view's index count and whether it is created with data.
| Parameter | Required | Description |
|---|---|---|
verbose | No | Include index details for each materialized view |
ask-forge list-materialized-views --verbose
PostgreSQL only. Shows the full definition of a materialized view: the SQL query, whether it is created with data, its tablespace and access method, any Apply Condition, and its indexes.
| Parameter | Required | Description |
|---|---|---|
name | Yes | The materialized view, for example public.my_view |
ask-forge show-materialized-view --name public.my_view
PostgreSQL only. Compares two materialized view definitions and reports the changes.
| Parameter | Required | Description |
|---|---|---|
view1 | Yes | The first view, given as schema.name or a bare name |
view2 | Yes | The second view, given the same way |
ask-forge diff-materialized-views --view1 public.sales --view2 public.sales_v2
SQL Server only. Lists every indexed view in the current template. With verbose: true, it adds each view's index count and whether it has a clustered index.
| Parameter | Required | Description |
|---|---|---|
verbose | No | Include index details for each indexed view |
ask-forge list-indexed-views --verbose
SQL Server only. Shows the full definition of an indexed view: the SQL query, any Apply Condition, and all indexes (clustered and nonclustered).
| Parameter | Required | Description |
|---|---|---|
name | Yes | The indexed view, for example dbo.my_view |
ask-forge show-indexed-view --name dbo.my_view
SQL Server only. Compares two indexed view definitions and reports the changes.
| Parameter | Required | Description |
|---|---|---|
view1 | Yes | The first view, given as schema.name or a bare name |
view2 | Yes | The second view, given the same way |
ask-forge diff-indexed-views --view1 dbo.my_view --view2 dbo.my_view_v2
All other tools operate on whatever context is currently selected, so a conversation usually starts by setting it:
schemasmith_navigate_context with template set to Reporting.schemasmith_show_context, which reports the product, platform, template and table count.diff_tables through schemasmith_execute_tool, with table1 and table2 set to the two tables, and gets back the column, index and foreign key differences.These tools interpret your schema, not just read it. Every Analyze tool but schemasmith_suggest_changes is Tier 1.
The schema health check. Runs five analyzers across the whole template and returns a health score out of 100 with a list of findings:
| Category | What it checks |
|---|---|
types | Oversized data types (NVARCHAR(MAX), TEXT, IMAGE); FK column type mismatches between child and parent tables |
indexing | Foreign key columns missing a supporting index, a common cause of slow JOINs and cascading DELETEs |
naming | Primary key, foreign key, index, and check constraint names against platform naming convention prefixes (PK_, FK_, IX_, CK_) |
nullability | Columns that are nullable but have names that suggest they should be required (Email, Status, CreatedDate); nullable columns with defaults that might benefit from NOT NULL |
relationships | Columns ending in Id that match a known table name but have no foreign key constraint — the "missing FK" detector |
Every finding includes a severity (Critical, Error, Warning, Info), a human-readable recommendation, and a ready-to-use fix script where applicable. Filter by specific tables or categories to focus your review.
| Parameter | Required | Description |
|---|---|---|
tables | No | Comma-separated table names (default: all tables) |
categories | No | Comma-separated categories to check (default: all) |
limit | No | Findings per call (default 20) |
offset | No | Findings to skip, for paging through them |
ask-forge review-schema --tables Orders,Customers --categories indexing
The relationship mapper. Analyzes foreign key dependencies across the whole template, in six modes:
| Mode | What it does |
|---|---|
list | Show what a table references and what references it (or all FK relationships template-wide) |
graph | Summary statistics: table count, FK count, most-connected tables, isolated tables |
circular | Detect circular dependency chains and self-references that could cause insertion order problems |
topological | Computes the insertion order for loading data, respecting all FK constraints |
cascade | For a specific table, trace the full cascade impact: which tables are affected at each depth level |
summary | Run all analyses at once |
Direction filtering (references, referenced_by, both) lets you focus on upstream or downstream dependencies.
| Parameter | Required | Description |
|---|---|---|
table | No | Table to analyze; omit for template-wide analysis. cascade needs one. |
analysis | No | Analysis mode (default list) |
direction | No | both, references, or referenced_by when a table is given (default both) |
ask-forge dependencies --table Orders --analysis cascade
The deployment planner. Compares your schema between two Git refs and produces a migration plan with platform-specific SQL. Point it at any two Git refs — branches, tags, commit SHAs, or working for the current state on disk. It diffs every table definition, detects added, removed and changed columns, and generates a step-by-step migration plan. Each step includes:
The plan as a whole also flags potential renames, with confidence scores and evidence.
The refs are read from the Git repository that holds the product. Use schemasmith_save_migration, a Tier 3 tool, afterward to write the plan and scripts to disk.
| Parameter | Required | Description |
|---|---|---|
source_ref | Yes | Git ref for the current or old schema version (branch, tag, SHA, or working) |
target_ref | No | Git ref for the new schema version (default working, the current files) |
template | No | Template name (default: the current template) |
platform | No | Platform for SQL generation (default: the current platform) |
limit | No | Steps per call (default 10) |
offset | No | Steps to skip, for paging through them |
ask-forge plan-migration --source-ref v1.2.0
Generates platform-specific SQL queries for checking data quality before a schema change. Three check types:
nulls: count and sample NULL values in a column (with percentage)orphans: find records that reference non-existent parent rows across foreign keysduplicates: detect duplicate value combinations across specified columnsThe queries are written in your product's platform syntax, with names quoted correctly whatever characters they hold. The tool writes the queries; you run them.
| Parameter | Required | Description |
|---|---|---|
check_type | Yes | nulls, orphans, or duplicates |
table | Yes | The table to check |
column | For nulls | The column to check for NULLs |
columns | For duplicates | Comma-separated columns to check for duplicates |
foreign_key | No | For orphans: check one named foreign key rather than all of them |
ask-forge check-data --check-type orphans --table Orders
Validates the whole package against the same shared validation engine SchemaHammer uses: a typed load of every table, template and product file, the generated .json-schema rules (including any hand-authored Extensions constraints), script-token resolution, and duplicate detection across columns, indexes, foreign keys, check constraints, and tables. Scope to a single table, the current template, or all templates. A package-wide failure, such as an unparseable Product.json, always surfaces regardless of scope, and a template that fails to load is reported while the other templates still validate.
On top of the engine's result, it reports above-floor capability usage as informational notes, not errors: validation still passes. Each note names the requirement, what happens below the floor, and the downgrade-manifest entry to search for afterwards. It also reports a table with a missing or empty Columns array, and a SQL Server indexed view with no index, or with no clustered index.
| Parameter | Required | Description |
|---|---|---|
scope | No | current_table, current_template, or all (default) |
ask-forge validate-json --scope current_template
Finds columns, tables, materialized views, or indexed views across the whole template, by name or data type. Matching is case-insensitive and by substring. Useful for questions such as "which tables have an Email column?"
| Parameter | Required | Description |
|---|---|---|
query | Yes | The search term |
field | No | column_name, data_type, table_name, materialized_view_name, indexed_view_name, or all (default) |
ask-forge search-schemas --query email --field column_name
Works out the naming conventions in your existing schema: PK naming pattern, PK data type preference, naming style (PascalCase, snake_case, or mixed), common audit columns, and FK target patterns. When Ask Forge generates new tables, through schemasmith_create_table or schemasmith_generate_schema, it uses the detected conventions, so run this first to see what the AI will follow. It takes no parameters.
ask-forge show-conventions
You just took over a project with 80 tables and no documentation.
schemasmith_review_schema to get the full health score and findings list.schemasmith_show_conventions (through schemasmith_execute_tool over MCP) to understand the naming patterns in use.schemasmith_dependencies with analysis set to summary to see the full relationship graph, circular chains, and insertion order.schemasmith_search_schemas for common patterns (Id, Date, Status) to understand the domain model.Before modifying a core table:
schemasmith_plan_migration with source_ref set to the release tag, such as v1.2.0, to see every change with SQL and risk levels.Tools for accessing documentation and operational history.
Search the built-in knowledge base for articles about tools, best practices, architecture patterns, and troubleshooting. Articles cover CI/CD integration, data type selection, indexing strategies, naming conventions, migration scripts, seed data management, rollback strategies, and more. It returns article summaries by default; full: true returns the complete article for the top match.
| Parameter | Required | Description |
|---|---|---|
query | Yes | Search term or natural-language question |
category | No | tools, best-practices, architecture, troubleshooting, getting-started, or reference |
platform | No | sqlserver, postgresql, mysql, or mariadb |
full | No | Return the top match's complete article rather than summaries (default false) |
ask-forge search-knowledge --query "before scripts"
View or locate log files from previous runs of the SchemaSmith Community tools: SchemaQuench, SchemaTongs, DataTongs and SchemaShears. Useful for debugging deployment issues or reviewing extraction results. Its output is masked the same way a Deploy tool's answer is.
| Parameter | Required | Description |
|---|---|---|
log_path | Yes | The log file to show; a Deploy tool's answer names its own |
tail_lines | No | Show only the last N lines (default 50), for a long log where the end is what matters |
open_external | No | Open the log in the system's default editor instead of returning its contents |
ask-forge view-log --log-path "SchemaQuench - Progress.log" --tail-lines 20
schemasmith_search_knowledge with query set to before scripts, and returns the migration scripts article.platform set to postgresql, and returns the articles that apply to PostgreSQL.view_log through schemasmith_execute_tool on the run's log, then searches the knowledge base for the error message and explains the solution.Tools for finding and running any SchemaSmith capability, including specialized tools that are not shown by default in the MCP tool list.
Search every registered tool by keyword or capability description; At a Glance states how many that is. It returns each matching tool's name, tier, description, and parameter schema. Use this when you need a tool that is not in the curated tool list, or when you are not sure which tool handles a specific task.
| Parameter | Required | Description |
|---|---|---|
query | Yes | A keyword or natural-language description of what you want to do |
ask-forge discover-tools --query "compare two tables"
Runs any SchemaSmith tool by name, including tools that are not listed directly in the MCP tool schema. Use it with schemasmith_discover_tools: find the tool first, then run it here.
| Parameter | Required | Description |
|---|---|---|
tool_name | Yes | The tool's name without the schemasmith_ prefix |
arguments | No | A JSON object of the tool's arguments |
confirm | When the tool is Tier 3 or 4 | Over MCP, confirm: true goes here, alongside tool_name, not inside arguments |
Running a tool through schemasmith_execute_tool is not a way around its tier. It is itself a Tier 1 tool. The tool it resolves decides the confirmation prompt and, where a trust level applies, the trust level, not the wrapper. Trust levels apply only to the conversational agent, in the REPL or a one-shot question; the MCP server and the ask-forge subcommands have none, so there a Tier 3 or Tier 4 target is something you confirm rather than something you are refused.
| Where | What a Tier 3 or Tier 4 target requires |
|---|---|
| MCP server | confirm: true on the execute_tool arguments, alongside tool_name, not inside the inner arguments JSON |
| Conversational agent | A trust level that permits that tier. At the default assistant, a Tier 3 or Tier 4 target is refused; the refusal names the tool, the tier, and the level. |
ask-forge execute-tool | A prompt, per your confirmationLevel setting. --yes skips it. |
ask-forge execute-tool --tool-name list_templates
Free schema-as-code for SQL Server, PostgreSQL, MySQL, and MariaDB.
The source is on GitHub for anyone to read.
Get Started on GitHub