Skip to main content
Glama
FortiManager MCP Server

FortiManager MCP Server

by rstierli

create_firewall_policy

Create a firewall policy in a specified policy package with interfaces, addresses, services, action, NAT, logging, and security profiles; install the package to activate the policy.

Instructions

Create a new firewall policy.

Creates a firewall policy in the specified policy package. The policy won't be active until the package is installed to devices.

Args: adom: ADOM name package: Policy package name name: Policy name srcintf: Source interfaces (e.g., ["internal"]) dstintf: Destination interfaces (e.g., ["wan1"]) srcaddr: Source addresses (e.g., ["all"]) dstaddr: Destination addresses (e.g., ["all"]) service: Services (e.g., ["ALL", "HTTP", "HTTPS"]) action: Policy action - "accept" or "deny" (default: "accept") schedule: Schedule object name (default: "always") nat: Enable NAT (default: False) logtraffic: Log mode - "all", "utm", or "disable" (default: "utm") status: Policy status - "enable" or "disable" (default: "enable") comments: Policy comments (optional) policyid: Specific policy ID (optional, auto-assigned if not set) srcaddr_negate: Match all sources EXCEPT srcaddr (optional; omitted from the payload when not set, leaving the FortiManager default) dstaddr_negate: Match all destinations EXCEPT dstaddr (optional) service_negate: Match all services EXCEPT service (optional) utm_status: Enable/disable security profile inspection on this policy (optional). Required (True) for any of the profile fields below to actually apply. av_profile: Antivirus profile name, e.g. "default" (optional) ips_sensor: IPS sensor name, e.g. "default" (optional) webfilter_profile: Web filter profile name (optional) dnsfilter_profile: DNS filter profile name (optional) application_list: Application control list name (optional) file_filter_profile: File filter profile name (optional) ssl_ssh_profile: SSL/SSH inspection profile name, e.g. "certificate-inspection" (optional) profile_protocol_options: Protocol options profile name (optional). Mutually exclusive with profile_group -- it is itself a member of the FortiOS firewall profile-group object, so FortiOS rejects setting both profile_group: Security profile group name (optional). Mutually exclusive with av_profile, ips_sensor, webfilter_profile, dnsfilter_profile, application_list, file_filter_profile, ssl_ssh_profile, and profile_protocol_options -- FortiOS rejects setting both

Returns: dict: Create result with keys: - status: "success" or "error" - policyid: Created policy ID - message: Status or error message

Example: >>> result = await create_firewall_policy( ... adom="root", ... package="default", ... name="Allow-Web-Traffic", ... srcintf=["internal"], ... dstintf=["wan1"], ... srcaddr=["LAN-Subnet"], ... dstaddr=["all"], ... service=["HTTP", "HTTPS"], ... action="accept", ... nat=True, ... utm_status=True, ... av_profile="default", ... ips_sensor="default", ... )

Input Schema

NameRequiredDescriptionDefault
natNo
adomYes
nameYes
actionNoaccept
statusNoenable
dstaddrYes
dstintfYes
packageYes
serviceYes
srcaddrYes
srcintfYes
commentsNo
policyidNo
scheduleNoalways
av_profileNo
ips_sensorNo
logtrafficNoutm
utm_statusNo
profile_groupNo
dstaddr_negateNo
service_negateNo
srcaddr_negateNo
ssl_ssh_profileNo
application_listNo
dnsfilter_profileNo
webfilter_profileNo
file_filter_profileNo
profile_protocol_optionsNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed13 schema fields changedv1.12.0
    • addedInput schema / properties / application_list
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Application List"
      +}
    • addedInput schema / properties / av_profile
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Av Profile"
      +}
    • addedInput schema / properties / dnsfilter_profile
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Dnsfilter Profile"
      +}
    • addedInput schema / properties / dstaddr_negate
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Dstaddr Negate"
      +}
    • addedInput schema / properties / file_filter_profile
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "File Filter Profile"
      +}
    • addedInput schema / properties / ips_sensor
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Ips Sensor"
      +}
    • addedInput schema / properties / profile_group
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Profile Group"
      +}
    • addedInput schema / properties / profile_protocol_options
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Profile Protocol Options"
      +}
    • addedInput schema / properties / service_negate
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Service Negate"
      +}
    • addedInput schema / properties / srcaddr_negate
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Srcaddr Negate"
      +}
    • addedInput schema / properties / ssl_ssh_profile
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Ssl Ssh Profile"
      +}
    • addedInput schema / properties / utm_status
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Utm Status"
      +}
    • addedInput schema / properties / webfilter_profile
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Webfilter Profile"
      +}
  2. First observed

TDQS

A4.2/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 behavioral burden and does well: it discloses the install-activation lifecycle, defaults, optional-field omission behavior, UTM gating via utm_status, and mutual exclusions. It still does not mention permission/lock requirements, idempotency, or rollback/error semantics for a mutation tool.

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?

The description is appropriately front-loaded and structured into summary, args, returns, and example. For 28 parameters, the length is largely justified, though the returns section duplicates the existing output schema and the example repeats many defaults already covered in the args list.

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?

For a complex 28-parameter mutation with no annotations, the description is quite complete: it covers every parameter, defaults, optional behavior, and important FortiOS constraints. It falls short of 5 because it omits operational prerequisites such as ADOM locking, permission requirements, and error/validation behavior.

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%, so the description must compensate fully, and it does: all 28 parameters are documented with examples, defaults, optionality, enum-like values, negate semantics, and mutual-exclusion constraints. This is substantially more informative than the bare schema titles.

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?

The description states a specific verb and resource, 'Create a new firewall policy,' and immediately scopes it to a policy package. The lifecycle note that the policy is not active until the package is installed clearly distinguishes creation from activation/install behavior.

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

Usage Guidelines3/5

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

The description gives useful context about package installation and defaults, but it does not explicitly say when to use this tool versus siblings such as update_firewall_policy or delete_firewall_policy. It also omits prerequisites such as whether the ADOM must be locked or referenced objects must already exist.

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