Before building an APEX app, use apex-mcp’s schema introspection tools to understand your database structure. Knowing your column types, primary keys, foreign keys, and table relationships upfront lets the CRUD generators make better decisions — and saves you from discovering schema mismatches after pages have already been created.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/TechFernandesLTDA/apex-mcp/llms.txt
Use this file to discover all available pages before exploring further.
apex_list_tables
Lists all tables and/or views in the current Oracle schema with row counts and optional column details. No parameters required after connecting.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
pattern | str | "%" | SQL LIKE pattern to filter object names |
include_columns | bool | True | Include column metadata for each object |
object_type | str | "TABLE" | "TABLE", "VIEW", or "ALL" |
Example
Return Structure
num_rows comes from Oracle table statistics (user_tables.num_rows) and may be stale if the table has not been analyzed recently. Run DBMS_STATS.GATHER_TABLE_STATS to refresh.apex_describe_table
Returns complete schema metadata for a single table: columns with types and lengths, primary key, foreign keys, indexes, associated sequences, and triggers.
Results are cached per session for 5 minutes to avoid redundant database round-trips when the same table is queried multiple times during a build.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
table_name | str | (required) | Table name (case-insensitive) |
force_refresh | bool | False | Bypass the 5-minute TTL cache and fetch fresh from the database |
Example
Return Structure
apex_detect_relationships
Auto-detects all foreign key relationships between a set of tables and suggests the best APEX component pattern for each relationship.
Use this before apex_generate_from_schema to understand the data model and anticipate how LOVs and master-detail pages will be wired.
Parameters
| Parameter | Type | Description |
|---|---|---|
tables | list[str] | Table names to analyze (case-insensitive) |
Example
Return Structure
suggested_component Logic
| Condition | Suggested Component |
|---|---|
Both tables in the input list AND from_table has more rows than to_table | master_detail |
| Both tables in the input list AND roughly equal row counts | select_lov |
| Referenced table is outside the input list | select_lov (external reference) |
internal: true means both sides of the FK are in your tables list. internal: false means the referenced parent table is outside the list — you may want to add it to the list or handle it separately.MCP Resources Alternative
The same schema data is available as read-only MCP resources — without making a tool call. Use these in AI client contexts that support resource reads.| Resource URI | Description |
|---|---|
apex://schema/tables | All tables in current schema (equivalent to apex_list_tables()) |
apex://schema/tables/{table_name} | Column metadata, PKs, and FKs for a specific table |
apex://config | Current connection status and workspace configuration |
apex://session | Active import session state — pages, regions, and items created so far |
apex://apps | APEX applications in the current workspace |
apex://apps/{app_id} | Detailed metadata and page list for a specific app |
Practical Workflow
Follow this sequence when starting any new APEX app build from an existing schema:Using Schema Info in Generators
Schema introspection feeds directly into generator behavior:-
apex_generate_crudqueriesuser_tab_columns,user_constraints, anduser_cons_columnsinternally. It uses column data types and naming conventions to infer APEX item types, and auto-creates LOVs for every FK column pointing to another table. -
apex_detect_relationshipsresults guide you in deciding whether to useapex_add_master_detail()(for parent-child relationships with many detail rows) or rely on the auto-generated select LOVs fromapex_generate_crud(for lookup/reference tables). -
apex_generate_from_schemarunsapex_generate_crudfor every table in your list and additionally performs a pre-scan of all FK relationships to log which LOVs will be created and which display columns will be used in each dropdown.
