apex-mcp provides two operational modes — batch and dry-run — that give you control over how and when generated PL/SQL reaches the database. Batch mode optimizes performance by collapsing many operations into a single network round-trip. Dry-run mode lets you inspect exactly what PL/SQL apex-mcp would execute, without touching the database at all. Both modes are controlled through standard tool calls and require no configuration changes.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.
Batch Mode
What It Does
Callingapex_begin_batch() puts the ConnectionManager into batch mode. From that point on, every db.plsql() call — which is what all component-creation tools use internally — queues its PL/SQL block in an in-memory list instead of executing it immediately. Nothing reaches the database until you call apex_commit_batch(), which sends all queued statements in a single connection round-trip and issues one COMMIT.
Why Use It
Each tool call normally executes one PL/SQL block and commits it individually. When you’re adding many components — a full CRUD page pair, a dashboard with multiple charts, or an app with dozens of items — each call incurs a separate network round-trip to Oracle. Batch mode eliminates this overhead by combining all statements into one execution, which can dramatically reduce total build time for complex applications.Example
Error Handling
apex_commit_batch() executes all queued statements in order. Each statement result is captured individually — errors on one statement do not abort the remaining queue. The tool returns a JSON object with:
status:"ok"if all statements succeeded,"partial"if any failed.executed: total number of statements attempted.ok: count of successful statements.errors: count of failed statements.log: list of per-statement result strings ("OK: ..."or"ERR: ...").
ConnectionManager.commit_batch() defaults to rollback_on_error=True, meaning the entire batch is rolled back if any statement fails and no partial changes are committed. This default ensures app builds remain in a consistent state on error.
Dry-Run Mode
What It Does
Callingapex_dry_run_preview(enabled=True) puts the ConnectionManager into dry-run mode. In this mode, every db.plsql() call appends the generated PL/SQL block to an in-memory log buffer instead of executing it. No database changes occur. Calling apex_dry_run_preview(enabled=False) disables dry-run mode and returns the full accumulated SQL log as a string.
Why Use It
Dry-run mode is the safest way to understand what apex-mcp will do before committing. Use it to:- Review generated code before running it in production.
- Debug tool behavior when a component isn’t being created as expected.
- Learn the PL/SQL API — see exactly which
wwv_flow_imp_page.*procedures are called and with what parameters. - Audit complex builds — capture the full SQL for a CRUD generator or schema-to-app workflow.
Example
Combining Modes
Dry-run mode takes precedence over batch mode. If both are active simultaneously,db.plsql() records statements in the dry-run log and does not add them to the batch queue. Nothing is executed, regardless of batch state.
If you enable dry-run mode while batch mode is already active, the batch queue is not affected — it retains whatever was queued before dry-run was enabled. Statements added while dry-run is active go only to the dry-run log.
Undoing the Last Operation
If you need to roll back a single component without abandoning the entire session, callapex_undo_last(). This undoes the most recently created component (region, item, button, etc.) by reverting the last tracked change in the ImportSession and issuing the appropriate DELETE call against the database.
apex_undo_last() only undoes one step at a time. For larger rollbacks, use apex_delete_region(), apex_delete_item(), or apex_delete_page() to remove specific components by ID.