Skip to main content
Glama
mdemirn

FortiGate MCP Server

by mdemirn

query_traffic_log

Query forward traffic logs to identify why a host is blocked or which policy handled a flow. Filter by source/destination IP, port, policy, action, or raw FortiOS expression.

Instructions

Query forward traffic logs with optional filters (most recent first).

Use it to answer "why is this host blocked / which policy handled this flow". Memory logs are the default (models without a log disk); pass source="disk" on models that log to disk.

Parameters:

  • device_id: Identifier of the FortiGate device

  • source_ip, destination_ip, destination_port, policy_id, action: Optional filters (action examples: deny, accept, close, timeout)

  • rows: Maximum records (default 50, max 500)

  • source: "memory" (default) or "disk"

  • raw_filter: Optional FortiOS filter expression, e.g. "srcip==192.0.2.25"

  • vdom: Virtual Domain name (optional)

Returns:

  • One line per log record: time, action, src -> dst, service, policy, bytes

Input Schema

NameRequiredDescriptionDefault
rowsNoMaximum records
vdomNoVirtual Domain
actionNoAction filter (deny, accept, close, ...)
sourceNoLog sourcememory
device_idYesFortiGate device identifier
policy_idNoPolicy ID filter
source_ipNoSource IPv4 filter
raw_filterNoRaw FortiOS filter expression
destination_ipNoDestination IPv4 filter
destination_portNoDestination port filter

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does substantial work: result ordering (most recent first), the memory-vs-disk default and its hardware dependency, row cap (default 50, max 500), and the exact return line format. It omits whether raw_filter overrides the typed filters and gives no permission or pagination context.

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 purpose and use case, then grouped Parameters/Returns blocks. Some parameter lines restate schema text, but the examples and defaults added to them justify the space.

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

Completeness4/5

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

With 10 parameters, no output schema, and no annotations, the description covers purpose, filters, defaults, and return shape, which is enough to call it correctly. The main residual gap is filter-combination behavior (typed filters vs raw_filter) for a log-query tool where that could change results.

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 baseline would be 3, but the description earns extra: action value examples, an explicit raw_filter syntax example ('srcip==192.0.2.25'), and the semantic rationale for the source enum (models without a log disk). The interaction between raw_filter and the other filters remains unexplained.

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 resource ('Query forward traffic logs') plus scoping ('optional filters, most recent first'). The 'forward traffic' qualifier cleanly separates it from the event-log and UTM-log siblings without needing to name them.

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 question-shaped use cases ('why is this host blocked / which policy handled this flow') and tells the agent when to pick source='disk' vs the memory default. It does not, however, state when to prefer a sibling like log_get or query_event_log instead.

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

Deploy Server

Other Tools