Reference for the built-in TypeScript tools that ship with the IBM i MCP Server — schema discovery, query validation, SQL execution, and DDL generation with zero configuration.
The IBM i MCP Server includes 7 built-in tools compiled directly into the server. These tools provide a complete text-to-SQL workflow out of the box — from schema discovery to query execution — without any YAML configuration or --tools flag.
Built-in vs YAML tools: Built-in tools are TypeScript implementations compiled into the server binary. YAML tools are user-defined SQL queries loaded at runtime via --tools. Both types coexist and appear identically to AI agents.
--execute-sql enables execute_sql for running queries
describe_sql_object is always available regardless of flags
Use --builtin-tools without --execute-sql to let agents explore the schema but route query execution through curated YAML tools with parameterized queries and security controls.
List available schemas/libraries on the IBM i system. Use this as the first step in schema discovery to find which schemas contain relevant tables.Catalog view:QSYS2.SYSSCHEMAS
Pagination: The response includes hasMore: true when additional rows are available beyond the current page. Increment offset by limit to fetch the next page.
List tables, views, and physical files in a specific schema with metadata including row counts. Use after list_schemas to find tables before querying column details.Catalog views:QSYS2.SYSTABLES joined with QSYS2.SYSTABLESTAT
Get column metadata for a table including names, data types, lengths, nullability, defaults, and descriptions. Use this to understand table structure before writing SQL queries.Catalog view:QSYS2.SYSCOLUMNS2
Get all objects that depend on a database file — views, indexes, triggers, foreign keys, logical files, and more. Use for impact analysis before schema changes or to understand a table’s dependency graph.Catalog function:SYSTOOLS.RELATED_OBJECTS
Validate SQL query syntax and verify that referenced tables, columns, functions, and procedures exist in the system catalog. This tool performs multi-step validation:
Syntax check — Uses QSYS2.PARSE_STATEMENT to parse the SQL statement
Table verification — Cross-references parsed table names against QSYS2.SYSTABLES
Column verification — Checks columns against QSYS2.SYSCOLUMNS
Routine verification — Verifies functions/procedures against QSYS2.SYSROUTINES
Confidence levels: Table validation is high-confidence — invalid tables will definitely cause query failures. Column and routine validation is advisory — CTE columns, UDTF outputs, and unqualified references may appear as false positives.
execute_sql applies two layers of validation before running any query:
AST/regex validation via SqlSecurityValidator — checks read-only mode constraints and query length
Native IBM i validation via QSYS2.PARSE_STATEMENT — confirms SQL_STATEMENT_TYPE = 'QUERY' when in read-only mode
By default, only SELECT queries are allowed (IBMI_EXECUTE_SQL_READONLY=true). Set IBMI_EXECUTE_SQL_READONLY=false to allow INSERT, UPDATE, DELETE, and other statement types.
Generate the SQL DDL statement for an IBM i database object. Use this to see the full CREATE definition of a table, view, index, procedure, function, or other object.Catalog procedure:QSYS2.GENERATE_SQL
All built-in tools include MCP tool annotations that help AI agents understand tool behavior:
Tool
readOnlyHint
destructiveHint
list_schemas
true
false
list_tables_in_schema
true
false
get_table_columns
true
false
get_related_objects
true
false
validate_query
true
false
execute_sql
Dynamic*
Dynamic*
describe_sql_object
true
false
*execute_sql annotations change based on IBMI_EXECUTE_SQL_READONLY: when true (default), readOnlyHint=true and destructiveHint=false; when false, readOnlyHint=false and destructiveHint=true.