Draft Rule from Natural Language
draft_ruleDraft an automation rule from a plain-language description (e.g. 'block POs over $10k when created'). On success returns a DISABLED draft rule alongside any detected conflicts, an approver hint and the Spark bot it was filed under with the reason (botSuggestion; pass another bot's id as botId to update_rule to move it). The rule is saved but inactive — review and enable it via update_rule. Returns declined reason or validation errors when the model cannot produce a valid rule.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"nlText": "<nlText>"
},
"name": "draft_rule"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nlText | Yes | Plain-language rule description. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | ||
| rule | No | ||
| errors | No | ||
| conflicts | No | ||
| approverHint | No | ||
| errorMessage | No | ||
| botSuggestion | No | ||
| declinedReason | No |