Skip to main content
Glama
rstierli

FortiManager MCP Server

by rstierli

create_local_in_policy

Create an IPv4 local-in policy to control traffic destined to the FortiGate management plane, defining allowed or denied services and source addresses by incoming interface.

Instructions

Create a new IPv4 local-in policy.

Local-in policies control traffic destined to the FortiGate's own management plane (GUI, SSH, ping, API, SNMP, etc.) -- a distinct object space from the regular firewall/policy table (create_firewall_policy), which governs traffic passing through the device. There is no srcintf/dstintf pair here: intf is the single incoming interface, since local-in traffic terminates on the FortiGate itself rather than being forwarded. A local-in policy only takes effect once its package is installed to a device (see preview_install / install_package).

Args: adom: ADOM name package: Policy package name intf: Incoming interface(s) this policy applies to, e.g. ["port1"] srcaddr: Source addresses this policy matches (e.g. ["Admin-Subnet"]) dstaddr: Destination addresses on the FortiGate itself (e.g. ["all"]) service: Services this policy matches, e.g. ["HTTPS", "SSH"] action: Policy action - "accept" or "deny" (default: "deny", the FortiOS field default -- unlike create_firewall_policy this defaults closed since it governs management-plane access) schedule: Schedule object name(s) (default: ["always"] if omitted) status: Policy status - "enable" or "disable" (default: "enable") logtraffic: Local-in traffic logging - "enable" or "disable" (optional) comments: Policy comments (optional) policyid: Specific policy ID (optional, auto-assigned if not set) srcaddr_negate: Match all sources EXCEPT srcaddr (optional) dstaddr_negate: Match all destinations EXCEPT dstaddr (optional) service_negate: Match all services EXCEPT service (optional) ha_mgmt_intf_only: Restrict this policy to the HA management interface only (optional). IPv4-only field -- there is no equivalent on create_local_in_policy6. virtual_patch: Enable/disable virtual patching on this policy (optional)

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

Example: >>> result = await create_local_in_policy( ... adom="root", ... package="default", ... intf=["port1"], ... srcaddr=["Admin-Subnet"], ... dstaddr=["all"], ... service=["HTTPS", "SSH"], ... action="accept", ... )

Input Schema

NameRequiredDescriptionDefault
adomYes
intfYes
actionNodeny
statusNoenable
dstaddrYes
packageYes
serviceYes
srcaddrYes
commentsNo
policyidNo
scheduleNo
logtrafficNo
virtual_patchNo
dstaddr_negateNo
service_negateNo
srcaddr_negateNo
ha_mgmt_intf_onlyNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.12.0

TDQS

A4.5/5.0
Behavior4/5

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

No annotations exist, so the description carries the full burden, and it does substantial work: it discloses the install-to-take-effect requirement, the surprising closed-by-default action="deny" with rationale versus create_firewall_policy, and default behaviors for schedule/status/policyid auto-assignment. It omits permissions/ADOM locking requirements and whether duplicate creation is idempotent, which keeps it short of a 5.

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 the conceptual distinction before the parameter list, which is the right ordering. The Args block is long but justified by 0% schema coverage; the Returns block duplicates the existing output schema and the example, while useful, pushes length beyond what is strictly needed.

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 17-parameter mutation tool with no annotations, the definition covers object space, all parameters, defaults, post-creation activation requirement, and a worked example. Return shape is already handled by the output schema, so nothing an agent needs to invoke this correctly is missing.

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% with 17 parameters, yet every parameter is documented in the description with type, examples, or semantics -- e.g. intf as the single incoming interface because there is no srcintf/dstintf pair, negate flags, and ha_mgmt_intf_only being IPv4-only. This fully compensates for the schema gap and adds meaning the schema cannot convey.

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 ("Create a new IPv4 local-in policy") and immediately distinguishes the object space from create_firewall_policy and implicitly from create_local_in_policy6 ("IPv4-only field -- there is no equivalent on create_local_in_policy6"). An agent can tell exactly what this creates and what it is not.

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?

Explains the domain distinction clearly: local-in governs traffic terminating on the FortiGate itself, while create_firewall_policy governs forwarded traffic, which routes the agent to the right sibling. It also discloses a critical usage prerequisite -- the policy only takes effect once its package is installed (see preview_install / install_package). No explicit "do not use when..." exclusion, but the context is sufficient to choose correctly.

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