km_add_if_calculation
Add conditional branching to a macro using a calculation condition like "Counter >= 5", with optional XML actions for true/false cases to control execution flow based on variable values.
Instructions
Add an If-Then-Else action that checks a calculation condition (e.g., "Counter >= 5").
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": {
"macroIdentifier": "<macroIdentifier>",
"calculation": "<calculation>"
},
"name": "km_add_if_calculation"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| calculation | Yes | Calculation condition (e.g., "Counter >= 5", "Price < MaxPrice") | |
| elseActionsXml | No | Optional: XML actions for false condition. Same format as thenActionsXml. | |
| thenActionsXml | No | Optional: XML actions for true condition. Pass one or more <dict>...</dict> elements concatenated (they get wrapped in <array>). Example: <dict><key>MacroActionType</key><string>Notification</string><key>Title</key><string>Hi</string><key>Text</key><string>Msg</string></dict> | |
| macroIdentifier | Yes | Macro name or UID |