Skip to main content
Glama

Batfish Run Assertion

batfish_run_assertion

Validate 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 (see batfish_list_assertions).

  • params: its parameters, e.g. {"headers": {"dstIps": "8.8.8.8", "ipProtocols": ["TCP"], "dstPorts": "443"}} for assert_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=True includes 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

NameRequiredDescriptionDefault
nameYes
debugNo
paramsNo
networkNo
questionNo
snapshotNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are supplied, so the description carries the full burden, and it does so well: it discloses that validation failures short-circuit execution ("status: 'error' ... nothing is run"), how failing rows surface via answer_rows vs a capped details payload, that messages are one-line summaries, and what debug=True adds. It does not state side-effect/reversibility properties or permission requirements, but for a read-style validation tool that gap is minor.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the purpose, then organized as a parameter list followed by return shape and pitfalls; every section is dense and useful. The enumerated return shape slightly duplicates the output schema, which is the only real waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a six-parameter tool with zero schema descriptions, this supplies parameter contracts, required-vs-conditional behavior, error semantics, and the domain pitfalls (ICMP default, broad-prefix representative flows) that an agent would otherwise get wrong. The output schema already covers return structure, so the description has no remaining burden.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% and all six parameters are explained: `name`, `params` with a worked example headers payload, `question`'s {fun, options} shape and when it is mandatory, `snapshot`/`network` precedence, and `debug`. It goes further with domain semantics absent from the schema — header field rules for srcIps/dstIps/ports and the ICMP default when ipProtocols is omitted.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and scope: "Validate and run one assertion on a snapshot." The singular "one assertion" distinguishes it from the sibling batfish_run_assertion_suite, and it points to batfish_list_assertions for the assertion catalog, so an agent can pick the right tool without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete conditional guidance: `question` is required for answer-based assertions (assert_zero_results, assert_num_results, assert_min_results), `snapshot`/`network` override the session defaults, and it explicitly recommends node names, interface locations, or explicit host IPs over broad prefixes. It stops short of naming the suite sibling as the alternative for multi-assertion runs.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.