Batfish Run Assertion
batfish_run_assertionValidate and run a single Batfish assertion on a network snapshot, checking flow or question results and returning pass/fail/error with concise details.
Instructions
Validate and run one assertion on a snapshot.
name: assertion type (seebatfish_list_assertions).params: its parameters, e.g.{"headers": {"dstIps": "8.8.8.8", "ipProtocols": ["TCP"], "dstPorts": "443"}}forassert_flows_succeed.question:{"fun": ..., "options": {...}}— required for answer-based assertions (assert_zero_results,assert_num_results,assert_min_results); the question is run first and its answer checked.snapshot/network: run on that snapshot (and network first), otherwise the session's current ones.debug=Trueincludes the raw Batfish error text on failures.
Returns {type, status (pass/fail/error), message, snapshot, ran_at, runtime, fun?, answer_rows?, details?, code?}. Failure messages are
short: message is the one-line summary, and failing rows are returned
as answer_rows when they can be parsed; otherwise details holds a
capped records-style payload. Validation problems are returned as
status: "error" with an errors list (nothing is run).
Header fields follow Batfish rules: srcIps/dstIps accept IPs,
prefixes, and node names; srcPorts/dstPorts are string specs such
as "443". When ipProtocols is omitted, Batfish tests ICMP, so set
ipProtocols and dstPorts for service-level assertions. Prefer node
names, interface locations, or explicit host IPs: broad prefixes may make
Batfish choose representative flows with network-address sources.
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": {
"name": "<name>"
},
"name": "batfish_run_assertion"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| debug | No | ||
| params | No | ||
| network | No | ||
| question | No | ||
| snapshot | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||