Skip to main content
Glama
amittell

firewalla-mcp-server

search_flows

Read-only

Query network flows by protocol, domain, region, or time range to analyze historical traffic, filter blocked connections, and paginate through large result sets.

Instructions

Search network flows with advanced query filters. Use this for: historical analysis, specific time ranges, complex filtering, or when you need more than 50 flows. Supports pagination, time-based queries (e.g., "ts:>1h" for the last hour, or Unix seconds such as "ts:1735689600-1735693200"), and all flow fields including geographic filtering. For quick "what's happening now" snapshots, use get_recent_flow_activity instead. Reads GET /v2/flows, 500 per request, following the cursor up to limit; coverage gives the oldest and newest ts returned and why paging stopped. Scoped to FIREWALLA_BOX_ID when set, otherwise every box.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum results (optional, default: 200, at most 1000; read 500 per request, following the cursor)
queryYesSearch query using Firewalla syntax. Terms joined by spaces or AND must all match; OR works between values of one field (sent as a comma list, e.g. region:US,CN) and is refused across fields; NOT or a leading - excludes. Supported fields: protocol:tcp/udp, direction:inbound/outbound/local, status:blocked/ok, total:>1MB (download + upload in B/KB/MB/GB/TB), download:>10MB, upload:>10MB, domain:example.com (the root domain: *.example.com matches nothing and *word* matches any domain containing word), region:US (country code), category:social/games/porn/etc, box.id:box_gid, device.ip:192.168.*, source.ip:*, destination.ip:*, ts:>1h. Examples: "region:US AND protocol:tcp", "status:blocked AND region:CN", "category:social OR category:games"
cursorNoPagination cursor from previous response
sortByNoSort flows (default: "ts:desc")
groupByNoFields to group by, comma-separated, e.g. "category", "domain", "device", "box" or "device,category". The API then returns groups instead of flows: groups of { key, count, download, upload, total }, where key holds the group fields (gid for box; for device the device with its name, but only its id for "device,category") and the rest are the group's summed connection count and bytes.
response_formatNoResponse format. 'json' (default): the compact JSON response. 'markdown': the same response as readable markdown, its fields as bullet lists and each list of records as a table of up to 8 columns and DEFAULT_PAGE_SIZE rows (default 100), ending with a line that says what the view leaves out. Omitted or null: 'json'. Errors are JSON either way.json
geographic_filtersNoCountries to limit the flows to, sent as one region: comma list ANDed with the query ({"countries": ["US", "CN"]} is sent as region:US,CN, either country). region, an ISO 3166 country code, is the one geographic flow qualifier the MSP API documents; other geographic filters (continents, cities, ASNs, hosting providers, risk scores) and names not listed here are refused as a validation error before any request.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv2.0.1
    • addedInput schema / properties / geographic_filters
      Added value: +{
      +  "description": "Countries to limit the flows to, sent as one region: comma list ANDed with the query ({\"countries\": [\"US\", \"CN\"]} is sent as region:US,CN, either country). region, an ISO 3166 country code, is the one geographic flow qualifier the MSP API documents; other geographic filters (continents, cities, ASNs, hosting providers, risk scores) and names not listed here are refused as a validation error before any request.",
      +  "properties": {
      +    "countries": {
      +      "description": "ISO 3166-1 alpha-2 country codes, any of which may match, e.g. [\"US\", \"CN\"]; a code that is not assigned is refused (put region:<code> in the query to send one anyway). An empty list asks for nothing.",
      +      "items": {
      +        "pattern": "^[A-Za-z]{2}$",
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "exclude_cloud": {
      +      "description": "Only false, which asks for nothing: the MSP API has no qualifier for cloud providers, so true is refused",
      +      "enum": [
      +        false
      +      ],
      +      "type": "boolean"
      +    },
      +    "exclude_known_providers": {
      +      "description": "Only false, which asks for nothing: the MSP API has no qualifier for hosting providers, so true is refused",
      +      "enum": [
      +        false
      +      ],
      +      "type": "boolean"
      +    },
      +    "exclude_vpn": {
      +      "description": "Only false, which asks for nothing: the MSP API has no qualifier for VPN traffic, so true is refused",
      +      "enum": [
      +        false
      +      ],
      +      "type": "boolean"
      +    },
      +    "high_risk_countries": {
      +      "description": "Only false, which asks for nothing: the MSP API has no qualifier for country risk, so true is refused",
      +      "enum": [
      +        false
      +      ],
      +      "type": "boolean"
      +    },
      +    "regions": {
      +      "description": "Country codes too, merged with countries: the API's region is a country code",
      +      "items": {
      +        "pattern": "^[A-Za-z]{2}$",
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "threat_analysis": {
      +      "description": "Only false, which asks for nothing: the flow search has no threat analysis, so true is refused",
      +      "enum": [
      +        false
      +      ],
      +      "type": "boolean"
      +    }
      +  },
      +  "type": "object"
      +}
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum results (optional, default: 200, API maximum: 500)"New value: +"Maximum results (optional, default: 200, at most 1000; read 500 per request, following the cursor)"
    • changedInput schema / properties / limit / maximum
      Previous value: -500New value: +1000
    • changedInput schema / properties / query / description
      Previous value: -"Search query using Firewalla syntax. Supported fields: protocol:tcp/udp, direction:inbound/outbound/local, status:blocked/ok, total:>1MB (download + upload in B/KB/MB/GB/TB), download:>10MB, upload:>10MB, domain:*.example.com, region:US (country code), category:social/games/porn/etc, box.id:box_gid, device.ip:192.168.*, source.ip:*, destination.ip:*, ts:>1h. Examples: \"region:US AND protocol:tcp\", \"status:blocked AND region:CN\", \"category:social OR category:games\""New value: +"Search query using Firewalla syntax. Terms joined by spaces or AND must all match; OR works between values of one field (sent as a comma list, e.g. region:US,CN) and is refused across fields; NOT or a leading - excludes. Supported fields: protocol:tcp/udp, direction:inbound/outbound/local, status:blocked/ok, total:>1MB (download + upload in B/KB/MB/GB/TB), download:>10MB, upload:>10MB, domain:example.com (the root domain: *.example.com matches nothing and *word* matches any domain containing word), region:US (country code), category:social/games/porn/etc, box.id:box_gid, device.ip:192.168.*, source.ip:*, destination.ip:*, ts:>1h. Examples: \"region:US AND protocol:tcp\", \"status:blocked AND region:CN\", \"category:social OR category:games\""
    • addedInput schema / properties / response_format
      Added value: +{
      +  "default": "json",
      +  "description": "Response format. 'json' (default): the compact JSON response. 'markdown': the same response as readable markdown, its fields as bullet lists and each list of records as a table of up to 8 columns and DEFAULT_PAGE_SIZE rows (default 100), ending with a line that says what the view leaves out. Omitted or null: 'json'. Errors are JSON either way.",
      +  "enum": [
      +    "json",
      +    "markdown",
      +    null
      +  ],
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
  2. Changed2 schema fields changedv1.5.0
    • changedInput schema / properties / groupBy / description
      Previous value: -"Group flows by specified values (e.g., \"domain,box\")"New value: +"Fields to group by, comma-separated, e.g. \"category\", \"domain\", \"device\", \"box\" or \"device,category\". The API then returns groups instead of flows: groups of { key, count, download, upload, total }, where key holds the group fields (gid for box; for device the device with its name, but only its id for \"device,category\") and the rest are the group's summed connection count and bytes."
    • changedInput schema / properties / query / description
      Previous value: -"Search query using Firewalla syntax. Supported fields: protocol:tcp/udp, direction:inbound/outbound/local, blocked:true/false, bytes:>1MB, domain:*.example.com, region:US (country code), category:social/games/porn/etc, gid:box_id, device.ip:192.168.*, source_ip:*, destination_ip:*. Examples: \"region:US AND protocol:tcp\", \"blocked:true AND bytes:>1MB\", \"category:social OR category:games\""New value: +"Search query using Firewalla syntax. Supported fields: protocol:tcp/udp, direction:inbound/outbound/local, status:blocked/ok, total:>1MB (download + upload in B/KB/MB/GB/TB), download:>10MB, upload:>10MB, domain:*.example.com, region:US (country code), category:social/games/porn/etc, box.id:box_gid, device.ip:192.168.*, source.ip:*, destination.ip:*, ts:>1h. Examples: \"region:US AND protocol:tcp\", \"status:blocked AND region:CN\", \"category:social OR category:games\""
  3. Changed1 schema field changedv1.3.0
    • changedInput schema / required
      Previous value: -[]New value: +[
      +  "query"
      +]
  4. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations cover safety (readOnlyHint, openWorldHint), and the description adds real behavioral context beyond them: it discloses the backing endpoint (GET /v2/flows), the 500-per-request page size and cursor-following up to limit, the contents of the 'coverage' field (oldest/newest ts and why paging stopped), and the FIREWALLA_BOX_ID scoping rule.

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 sentence, then usage, then mechanics. Every sentence carries information, though the description is dense and the query-example list makes it longer than strictly necessary.

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?

No output schema exists, yet the description explains what comes back (flows vs. grouped {key,count,download,upload,total}, the coverage field, markdown table limits), which is exactly the burden the description must carry for a 7-parameter, open-world search tool.

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

Parameters4/5

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

Schema coverage is 100% so the baseline is 3, but the description adds meaning beyond the schema by tying the query, pagination and coverage semantics together and showing time syntax ('ts:>1h', Unix-seconds ranges). It slightly restates limit/query details that already live in the schema, keeping it just short of 5.

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+resource ('Search network flows') plus the scope (advanced query filters) and names the sibling it differs from (get_recent_flow_activity for 'what's happening now' snapshots). An agent can distinguish it from get_flow_data/get_flow_trends by the stated 'historical analysis, complex filtering, >50 flows' framing.

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

Usage Guidelines5/5

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

Explicitly enumerates when to use it (historical analysis, specific time ranges, complex filtering, more than 50 flows) and names the alternative with the condition that selects it: get_recent_flow_activity for quick current snapshots. Nothing is left to inference.

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