km_set_action_xml
Set or replace the XML of a specific action in a Keyboard Maestro macro using the macro identifier and action index.
Instructions
Set/replace the XML of a specific action in a macro. Use km_get_action_xml first to get the current XML.
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>",
"actionIndex": "<actionIndex>",
"xml": "<xml>"
},
"name": "km_set_action_xml"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| xml | Yes | New XML for the action | |
| actionIndex | Yes | Action index (1-based) | |
| macroIdentifier | Yes | Macro name or UID |