Batfish Run Question
batfish_run_questionRun Batfish questions on network snapshots to return JSON-safe rows, including differential comparisons and trace-detail controls for configuration analysis.
Instructions
Run a Batfish question and return its JSON-safe rows.
funis the pybatfish question function name (seebatfish_list_questions);optionsis its keyword-argument dict.snapshotruns the question on that snapshot (the session's current snapshot otherwise).reference_snapshot+snapshotruns a differential question comparing the two; both are required for differential questions. In the answer,Snapshot_*columns come fromsnapshot(the snapshot under test) andReference_*columns come fromreference_snapshot(the baseline).networkpoints the session at a network first, if given.debug=Trueincludes the raw Batfish exception log in the response.trace_detailcontrols trace columns (Traces,Snapshot_Traces,Reference_Traces):"summary"(default) keeps disposition, node path, and hop count;"none"drops the trace columns but keeps the trace counts;"full"returns the original hop-by-hop traces.max_rowscaps the number of returned rows (default 50). Use0for no limit;total_rows,returned_rows, andtruncatedreport whether the cap was applied.A named
snapshot/reference_snapshotmust exist in the network; otherwise aValueErrorlists the available snapshots.
Returns {fun, snapshot, reference_snapshot, status, rows, removed_columns, total_rows, returned_rows, truncated} where rows is
a list of row dicts. A differentialReachability answer also includes
trace_columns, which maps Snapshot_Traces to the snapshot
argument and Reference_Traces to reference_snapshot. A Batfish
failure returns {status: "error", code, message, rows: []} instead of
raising; known codes include SNAPSHOT_INCOMPATIBLE,
INVALID_ARGUMENT, INVALID_PORT_SPEC, and
BIDIRECTIONAL_REQUIRES_DST.
Header values are Batfish specifiers: srcIps/dstIps accept IPs,
prefixes, node names, or named IP spaces; srcPorts/dstPorts take
strings such as "443". If ipProtocols is omitted, Batfish tests
ICMP, so set ipProtocols and dstPorts for service-level checks.
Batfish returns representative flows for broad headers, so a prefix such
as 10.0.0.0/24 may yield a network or broadcast source; prefer node
names, interface locations, or explicit host IPs for realistic examples.
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": {
"fun": "<fun>"
},
"name": "batfish_run_question"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fun | Yes | ||
| debug | No | ||
| network | No | ||
| options | No | ||
| max_rows | No | ||
| snapshot | No | ||
| trace_detail | No | summary | |
| reference_snapshot | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||