test_macro
Runs the tests an exposed macro declares, sealed off from the Mac, so an agent that wrote or changed a macro can prove it still works.
Details #
A test is a sealed dry run. Nothing is pressed, typed, copied or sent, and no extension or model is called, so no approval is needed. The answer lists each test, whether it passed, and in words what was wrong for one that did not.
{ "jsonrpc": "2.0", "id": 8, "method": "tools/call",
"params": { "name": "test_macro", "arguments": { "name": "Slugify" } } }
{
"macro": "Slugify",
"summary": "1 of 2 tests pass",
"passed": false,
"tests": [
{ "name": "lowercases", "passed": true, "runId": "r_1a2b" },
{ "name": "keeps case", "passed": false, "failed": "Expected to give back 'DAY-412', gave back 'day-412'", "runId": "r_3c4d" }
]
}
Read a sealed run with get_trace and its runId.
Gotchas #
Only macros the user exposed to agents can be tested.
A macro with no tests answers with a
notesaying so. A person saves a test from a run in Activity.Rate-limited like run_macro: 60 a minute.
A test never blocks anything.