Read-Only Tools

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

Ask Forge read-only tools

Scan your template and discover what conventions are actually in use — not what someone wrote in a wiki three years ago.

What Tier 1 Covers

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.

Over MCP and on the CLI

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_contextExploreIn the tool list
schemasmith_navigate_contextExploreIn the tool list
schemasmith_list_templatesExploreThrough schemasmith_execute_tool
schemasmith_list_tablesExploreIn the tool list
schemasmith_show_tableExploreIn the tool list
schemasmith_diff_tablesExploreThrough schemasmith_execute_tool
schemasmith_list_foldersExploreThrough schemasmith_execute_tool
schemasmith_list_scriptsExploreThrough schemasmith_execute_tool
schemasmith_list_connectionsExploreThrough schemasmith_execute_tool
schemasmith_show_configExploreThrough schemasmith_execute_tool
schemasmith_show_platform_capabilitiesExploreThrough schemasmith_execute_tool
schemasmith_audit_version_floorExploreThrough schemasmith_execute_tool
schemasmith_list_materialized_viewsExploreThrough schemasmith_execute_tool
schemasmith_show_materialized_viewExploreThrough schemasmith_execute_tool
schemasmith_diff_materialized_viewsExploreThrough schemasmith_execute_tool
schemasmith_list_indexed_viewsExploreThrough schemasmith_execute_tool
schemasmith_show_indexed_viewExploreThrough schemasmith_execute_tool
schemasmith_diff_indexed_viewsExploreThrough schemasmith_execute_tool
schemasmith_review_schemaAnalyzeIn the tool list
schemasmith_dependenciesAnalyzeIn the tool list
schemasmith_plan_migrationAnalyzeIn the tool list
schemasmith_check_dataAnalyzeThrough schemasmith_execute_tool
schemasmith_validate_jsonAnalyzeIn the tool list
schemasmith_search_schemasAnalyzeIn the tool list
schemasmith_show_conventionsAnalyzeThrough schemasmith_execute_tool
schemasmith_search_knowledgeLearnIn the tool list
schemasmith_view_logLearnThrough schemasmith_execute_tool
schemasmith_discover_toolsDiscoverIn the tool list
schemasmith_execute_toolDiscoverIn the tool list

Explore

Tools for browsing and inspecting your schema package. All read-only, so running them never changes your schema package.

schemasmith_show_context

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.

ParameterRequiredDescription
productNoPath to the product directory to load
templateNoTemplate name to select
tableNoTable name to focus on
working_directoryNoSets where file operations resolve when no product is loaded. Useful before a first extraction, when there is no product to anchor paths to yet.
clearNoClears the current context, so the next product is loaded fresh
ask-forge navigate-context --product my-product --template Main

schemasmith_list_templates

Lists every template in the current product. It takes no parameters.

ask-forge list-templates

schemasmith_list_tables

Lists every table in the current template. With verbose: true, it adds column counts and key information for each table.

ParameterRequiredDescription
verboseNoInclude column counts and key information (default false)
ask-forge list-tables --verbose

schemasmith_show_table

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.

ParameterRequiredDescription
tableNoThe table to show; optional if a table is already selected in context
ask-forge show-table --table Customers

schemasmith_diff_tables

Compares two table definitions side by side. It reports added, removed, and changed columns, keys, and indexes.

ParameterRequiredDescription
table1YesFirst table name
table2YesSecond table name
ask-forge diff-tables --table1 Customers --table2 Suppliers

schemasmith_list_folders

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

schemasmith_list_scripts

Lists the scripts in one folder. Useful for reviewing migration scripts or object definitions.

ParameterRequiredDescription
folderYesName of the script folder to list
ask-forge list-scripts --folder Procedures

schemasmith_list_connections

Lists all configured database connections. Passwords and secret-looking connection properties are masked.

ParameterRequiredDescription
platformNoOne platform's connection; defaults to the context's platform, or every connection when there is none
ask-forge list-connections --platform PostgreSQL

schemasmith_show_config

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.

ParameterRequiredDescription
sectionNoconnections or all (default)
ask-forge show-config --section connections

schemasmith_show_platform_capabilities

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.

ParameterRequiredDescription
platformNoThe platform to report on; defaults to the context's platform
ask-forge show-platform-capabilities --platform PostgreSQL

schemasmith_audit_version_floor

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

schemasmith_list_materialized_views PostgreSQL

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.

ParameterRequiredDescription
verboseNoInclude index details for each materialized view
ask-forge list-materialized-views --verbose

schemasmith_show_materialized_view PostgreSQL

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.

ParameterRequiredDescription
nameYesThe materialized view, for example public.my_view
ask-forge show-materialized-view --name public.my_view

schemasmith_diff_materialized_views PostgreSQL

PostgreSQL only. Compares two materialized view definitions and reports the changes.

ParameterRequiredDescription
view1YesThe first view, given as schema.name or a bare name
view2YesThe second view, given the same way
ask-forge diff-materialized-views --view1 public.sales --view2 public.sales_v2

schemasmith_list_indexed_views SQL Server

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.

ParameterRequiredDescription
verboseNoInclude index details for each indexed view
ask-forge list-indexed-views --verbose

schemasmith_show_indexed_view SQL Server

SQL Server only. Shows the full definition of an indexed view: the SQL query, any Apply Condition, and all indexes (clustered and nonclustered).

ParameterRequiredDescription
nameYesThe indexed view, for example dbo.my_view
ask-forge show-indexed-view --name dbo.my_view

schemasmith_diff_indexed_views SQL Server

SQL Server only. Compares two indexed view definitions and reports the changes.

ParameterRequiredDescription
view1YesThe first view, given as schema.name or a bare name
view2YesThe second view, given the same way
ask-forge diff-indexed-views --view1 dbo.my_view --view2 dbo.my_view_v2

Moving through a product

All other tools operate on whatever context is currently selected, so a conversation usually starts by setting it:

  1. "Switch to the Reporting template." The AI calls schemasmith_navigate_context with template set to Reporting.
  2. "Where am I?" The AI calls schemasmith_show_context, which reports the product, platform, template and table count.
  3. "Compare the Customers and Suppliers tables to see how they differ." The AI runs 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.

Analyze

These tools interpret your schema, not just read it. Every Analyze tool but schemasmith_suggest_changes is Tier 1.

schemasmith_review_schema

The schema health check. Runs five analyzers across the whole template and returns a health score out of 100 with a list of findings:

CategoryWhat it checks
typesOversized data types (NVARCHAR(MAX), TEXT, IMAGE); FK column type mismatches between child and parent tables
indexingForeign key columns missing a supporting index, a common cause of slow JOINs and cascading DELETEs
namingPrimary key, foreign key, index, and check constraint names against platform naming convention prefixes (PK_, FK_, IX_, CK_)
nullabilityColumns 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
relationshipsColumns 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.

ParameterRequiredDescription
tablesNoComma-separated table names (default: all tables)
categoriesNoComma-separated categories to check (default: all)
limitNoFindings per call (default 20)
offsetNoFindings to skip, for paging through them
ask-forge review-schema --tables Orders,Customers --categories indexing

schemasmith_dependencies

The relationship mapper. Analyzes foreign key dependencies across the whole template, in six modes:

ModeWhat it does
listShow what a table references and what references it (or all FK relationships template-wide)
graphSummary statistics: table count, FK count, most-connected tables, isolated tables
circularDetect circular dependency chains and self-references that could cause insertion order problems
topologicalComputes the insertion order for loading data, respecting all FK constraints
cascadeFor a specific table, trace the full cascade impact: which tables are affected at each depth level
summaryRun all analyses at once

Direction filtering (references, referenced_by, both) lets you focus on upstream or downstream dependencies.

ParameterRequiredDescription
tableNoTable to analyze; omit for template-wide analysis. cascade needs one.
analysisNoAnalysis mode (default list)
directionNoboth, references, or referenced_by when a table is given (default both)
ask-forge dependencies --table Orders --analysis cascade

schemasmith_plan_migration

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:

  • Platform-native SQL (ALTER TABLE, CREATE INDEX, and so on)
  • Risk level assessment
  • Data advisories, such as a warning that a dropped column's data will be lost
  • Validation queries for a risky step, such as a count of the NULLs that would stop a column becoming NOT NULL

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.

ParameterRequiredDescription
source_refYesGit ref for the current or old schema version (branch, tag, SHA, or working)
target_refNoGit ref for the new schema version (default working, the current files)
templateNoTemplate name (default: the current template)
platformNoPlatform for SQL generation (default: the current platform)
limitNoSteps per call (default 10)
offsetNoSteps to skip, for paging through them
ask-forge plan-migration --source-ref v1.2.0

schemasmith_check_data

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 keys
  • duplicates: detect duplicate value combinations across specified columns

The 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.

ParameterRequiredDescription
check_typeYesnulls, orphans, or duplicates
tableYesThe table to check
columnFor nullsThe column to check for NULLs
columnsFor duplicatesComma-separated columns to check for duplicates
foreign_keyNoFor orphans: check one named foreign key rather than all of them
ask-forge check-data --check-type orphans --table Orders

schemasmith_validate_json

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.

ParameterRequiredDescription
scopeNocurrent_table, current_template, or all (default)
ask-forge validate-json --scope current_template

schemasmith_search_schemas

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?"

ParameterRequiredDescription
queryYesThe search term
fieldNocolumn_name, data_type, table_name, materialized_view_name, indexed_view_name, or all (default)
ask-forge search-schemas --query email --field column_name

schemasmith_show_conventions

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

Inherited database audit

You just took over a project with 80 tables and no documentation.

  1. Run schemasmith_review_schema to get the full health score and findings list.
  2. Run schemasmith_show_conventions (through schemasmith_execute_tool over MCP) to understand the naming patterns in use.
  3. Run schemasmith_dependencies with analysis set to summary to see the full relationship graph, circular chains, and insertion order.
  4. Search with schemasmith_search_schemas for common patterns (Id, Date, Status) to understand the domain model.
  5. Follow up with schemasmith_suggest_changes on the worst findings to get migration scripts for fixes. It is a Tier 2 tool.

Cascade chain analysis

Before modifying a core table:

  1. Run schemasmith_dependencies with the table and cascade analysis to see what depends on it.
  2. Run schemasmith_dependencies with topological analysis to see the insertion order.
  3. Run schemasmith_suggest_changes on your planned modifications to get the full risk assessment, with materialized and indexed view impact warnings.

What changed since the last release?

  1. Run 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.
  2. Review the high-risk steps: column type changes, column removals, table drops.
  3. Check the potential renames, and confirm or reject the tool's suggestions.
  4. Save the plan with schemasmith_save_migration, which produces a markdown summary and SQL scripts for documentation.

Learn

Tools for accessing documentation and operational history.

schemasmith_search_knowledge

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.

ParameterRequiredDescription
queryYesSearch term or natural-language question
categoryNotools, best-practices, architecture, troubleshooting, getting-started, or reference
platformNosqlserver, postgresql, mysql, or mariadb
fullNoReturn the top match's complete article rather than summaries (default false)
ask-forge search-knowledge --query "before scripts"

schemasmith_view_log

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.

ParameterRequiredDescription
log_pathYesThe log file to show; a Deploy tool's answer names its own
tail_linesNoShow only the last N lines (default 50), for a long log where the end is what matters
open_externalNoOpen 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

Learning while working

  1. "How do Before Scripts work?" The AI calls schemasmith_search_knowledge with query set to before scripts, and returns the migration scripts article.
  2. "What are the best practices for indexing on PostgreSQL?" The AI calls schemasmith_search_knowledge with query set to indexing and platform set to postgresql, and returns the articles that apply to PostgreSQL.
  3. "The deployment failed. What happened?" The AI runs view_log through schemasmith_execute_tool on the run's log, then searches the knowledge base for the error message and explains the solution.

Discover

Tools for finding and running any SchemaSmith capability, including specialized tools that are not shown by default in the MCP tool list.

schemasmith_discover_tools

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.

ParameterRequiredDescription
queryYesA keyword or natural-language description of what you want to do
ask-forge discover-tools --query "compare two tables"

schemasmith_execute_tool

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.

ParameterRequiredDescription
tool_nameYesThe tool's name without the schemasmith_ prefix
argumentsNoA JSON object of the tool's arguments
confirmWhen the tool is Tier 3 or 4Over 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.

WhereWhat a Tier 3 or Tier 4 target requires
MCP serverconfirm: true on the execute_tool arguments, alongside tool_name, not inside the inner arguments JSON
Conversational agentA 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-toolA prompt, per your confirmationLevel setting. --yes skips it.
ask-forge execute-tool --tool-name list_templates

Finding a tool by description

  1. Call schemasmith_discover_tools with a description of what you want to do.
  2. Identify the tool name from the results.
  3. Call schemasmith_execute_tool with the tool name and parameters.

Shape. Strengthen. Succeed.

Free schema-as-code for SQL Server, PostgreSQL, MySQL, and MariaDB.

The source is on GitHub for anyone to read.

Get Started on GitHub