generate_rule_spec
Generates a complete business rule specification from natural language, including IF/THEN/ELSE logic, field validation, and best practice recommendations.
Instructions
Generate a complete Business Rule specification from a natural language requirement.
This tool:
Queries the SF instance metadata to identify relevant fields
Validates all referenced fields and picklist values exist
Builds IF/THEN/ELSE condition logic
Generates naming, execution notes, and best practice recommendations
The output can be passed to generate_rule_doc (documentation) and generate_rule_test (test cases).
Example requirement: "When saving Job Information, if the employee's country is Peru and employee class is Full-Time, set pay group to PG_PE_FT. If Part-Time, set to PG_PE_PT."
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rule_name | No | ||
| event_type | Yes | Event type: 'onSave', 'onChange', 'onInit', or 'validate' | |
| base_object | Yes | Base object (e.g., 'JobInformationModel', 'CompInfoModel') | |
| data_center | No | ||
| requirement | Yes | Natural language description of the business rule requirement | |
| auth_user_id | No | ||
| auth_password | No | ||
| country_scope | No | ||
| rule_scenario | Yes | Rule scenario (e.g., 'Rules for Employee Central', 'Event Reason Derivation') | |
| conditions_hint | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||