Skip to main content
Glama
FortiManager MCP Server

FortiManager MCP Server

by rstierli

create_firewall_policy

Creates a firewall policy in a FortiManager policy package, defining interfaces, addresses, services, action, NAT, and security profiles; install the package to activate it.

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 install_on: Install the policy only on these targets (optional; by default it installs on every device the package goes to). Each entry is a device {"name": "branch1", "vdom": "root"} or a device group {"name": "emea_spokes"}

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", ... )

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": {
      "adom": "<adom>",
      "package": "<package>",
      "name": "<name>",
      "srcintf": "<srcintf>",
      "dstintf": "<dstintf>",
      "srcaddr": "<srcaddr>",
      "dstaddr": "<dstaddr>",
      "service": "<service>"
    },
    "name": "create_firewall_policy"
  }
}

Input Schema

NameRequiredDescriptionDefault
natNo
adomYes
nameYes
actionNoaccept
statusNoenable
dstaddrYes
dstintfYes
packageYes
serviceYes
srcaddrYes
srcintfYes
commentsNo
policyidNo
scheduleNoalways
av_profileNo
install_onNo
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. Changed1 schema field changedv1.13.1
    • addedInput schema / properties / install_on
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "additionalProperties": {
      +          "type": "string"
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Install On"
      +}
  2. 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"
      +}
  3. First observed

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral load and does well: it discloses the install-gating behavior, that utm_status=True is required for any profile field to apply, that profile_group is mutually exclusive with every individual profile (and why -- FortiOS rejects both), and that negate fields are omitted from the payload to preserve FortiManager defaults. It does not cover permissions/auth requirements or duplicate-name behavior.

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?

It is well structured and front-loaded: one-line purpose, scoping sentence, Args, Returns, and a runnable example, so an agent can stop reading at any depth. The opening two lines are partially redundant ('Create a new firewall policy' / 'Creates a firewall policy in the specified policy package'), and the example is long, but nothing is wasted at this parameter count.

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 29-parameter mutation tool with no annotations, this is close to complete: it explains defaults, conditional semantics (utm_status gating), mutually exclusive combinations, payload-omission behavior, and install scope. Return values are also documented even though an output schema exists, which is redundant but harmless; the remaining gap is error/validation behavior such as duplicate names or missing referenced objects.

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 description coverage is 0% across 29 parameters, and the description documents essentially every one of them with defaults, enum-like value hints ('accept'/'deny', 'all'/'utm'/'disable'), and list examples. A few entries merely restate the name (adom: 'ADOM name', name: 'Policy name'), and install_on's device-group form is only lightly illustrated, keeping this from a 5.

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

Purpose4/5

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

The description leads with a specific verb+resource ('Create a new firewall policy') and scopes it to 'the specified policy package', which cleanly separates it from update/delete/get siblings. It stops short of explicitly naming an alternative, so it is clear but not maximally differentiating.

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?

It gives a useful usage fact -- the policy is inert until the package is installed to devices -- which tells the agent this is a staged create rather than an immediate effect. There is no explicit when-to-use vs when-not guidance, no mention of prerequisites such as address/interface objects needing to exist, and no comparison to update_firewall_policy.

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