Skip to main content
Glama
rstierli

FortiManager MCP Server

by rstierli

revert_firewall_policy

Restore a firewall policy to a past change-log snapshot by updating the live policy with config captured from list_policy_revisions, then push it to devices with preview_install and install_package.

Instructions

Restore a firewall policy to a past change-log snapshot.

FortiManager has no dedicated revert-firewall-policy endpoint. The documented mechanism (How-To 008, "How to revert a firewall policy from a past changes?") is to capture a past change's config snapshot from list_policy_revisions and update the live policy with it -- this tool does exactly that. This writes a policy OBJECT inside the ADOM's policy package; it does not touch any device. Push the reverted policy to devices the same way any other policy edit is pushed: preview_install then install_package.

Args: adom: ADOM name package: Policy package name config: A snapshot from list_policy_revisions' "config" field -- either the JSON string as returned, or the already-decoded dict. Must include "policyid". Any "oid" key is stripped automatically (FortiManager rejects the write if it is present). revision_note: Optional note recorded against this change

Returns: dict: status, adom, package, policyid, message

Example: >>> revisions = await list_policy_revisions("demo", "ppkg_001", policyid=14) >>> await revert_firewall_policy( ... "demo", "ppkg_001", revisions["changes"][0]["config"], ... revision_note="Revert from create time", ... )

Input Schema

NameRequiredDescriptionDefault
adomYes
configYes
packageYes
revision_noteNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.12.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations at all, the description carries the full burden and does it well: it discloses that a policy object is written inside the ADOM package and that no device is touched, notes the oid-stripping behavior and that policyid is required, and spells out the return dict keys. These are specific side-effect and gotcha disclosures that the schema does not capture.

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 front-loaded with the core purpose, then uses clean Args/Returns/Example sections. It is on the longer side, but the mechanism explanation and example both earn their place given the non-obvious underlying endpoint.

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 mutation tool with no annotations and 0% schema coverage, the description is complete: it covers what is written, what is not touched, required inputs, the oid caveat, the push follow-up, and it even lists return keys despite an output schema existing. Nothing an agent needs to call it 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 coverage is 0%, so the description must compensate, and it does: adom and package as names, config explained as either a JSON string or decoded dict that must include policyid and have oid stripped, and revision_note as an optional recorded note. All four parameters get meaning beyond the raw schema.

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 ('Restore a firewall policy to a past change-log snapshot') and immediately distinguishes the mechanism from a normal update, noting there is no dedicated revert endpoint. An agent can tell this apart from update_firewall_policy without opening either schema.

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?

It explains the context clearly: use list_policy_revisions to capture a config snapshot, then this tool, then preview_install/install_package to push. It does not explicitly state when NOT to use this tool or name the specific sibling alternative, but the workflow routing is strong.

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