sqlmc_list_coverage: It asks before it connects
This is the part an agent author must get right.
This is the part an agent author must get right.
Call it without confirmationToken. It connects to nothing and returns the plan:
{
"ok": true, "errors": [],
"listName": "All Prod",
"confirmationRequired": true,
"confirmationToken": "a41f…",
"targetCount": 12,
"alreadyCached": 9,
"productionTargets": [
{ "connection": "sql-prod-01", "database": "Sales", "isProduction": true }
],
"scanned": 0, "failed": 0, "cancelled": false, "findings": []
}
Call again with that token to run it.
The token is derived from the plan, so it stops matching the moment the group's membership changes. The caller is then handed a fresh plan rather than quietly reading a database it never agreed to. Comparison is ordinal: a token echoed back differing by case is a token that did not come from here.