Creates and registers a commit action tool for AI to execute actions (WRITE pattern).
This implements the WRITE side of the command pattern - AI calls tool to modify system state.
Flow:
AI calls tool with parameters
validateParams runs (if provided) - validates parameters and returns error message or null
If validation fails:
Error message is committed as tool output
failureMessage is executed (or error message if failureMessage not provided)
Flow stops
If validation passes:
executeAction runs - performs the action
Action result is committed as tool output (or emptyContent if result is empty)