run_macro
Runs an exposed macro by id or name, waits for it to finish and returns its status, returned value and failure in words.
Details #
The server finds the macro among the exposed ones. It checks the inputs against the macro's declared inputs, asks for approval if the macro needs it, starts the run through the engine tagged byAgent with the client's name, and waits up to the macro's timeout plus 10 seconds.
{ "jsonrpc": "2.0", "id": 2, "method": "tools/call",
"params": { "name": "run_macro", "arguments": { "name": "Paste ticket as title", "inputs": { "key": "DAY-412" } } } }
The result text is JSON:
{
"runId": "r_91c0d2",
"status": "succeeded",
"dryRun": false,
"macro": "Paste ticket as title",
"steps": [{ "id": "s1", "status": "ok" }],
"returned": "DAY-412: Fix login",
"approvedBy": "user"
}
When the run fails, isError is true and failure says what happened in plain words:
{
"runId": "r_91c0d3",
"status": "failed",
"dryRun": false,
"macro": "Paste ticket as title",
"steps": [{ "id": "s2", "status": "failed", "note": "element not found" }],
"failure": "Step s2 (click) failed. Pick the element again."
}
returned is the output of the macro's return step, or else of the last step that succeeded. It is left out for a dry run.
Gotchas #
Past 60 runs a minute across all agents, the call returns a rate limit error. Dry runs count.
If the run is still going after the wait, the result has a
note; call get_trace with therunIdlater.Macros that are not exposed answer
No exposed macro matches.