Skip to main content
Glama
FortiManager MCP Server

FortiManager MCP Server

by rstierli

preview_install

Preview the FortiOS CLI changes an install would push to selected devices before committing, with per-device output and FortiManager failure reasons.

Instructions

Preview what installing a policy package (or device settings) would push.

On FortiManager 7.6.7+ and 8.0.2+ this runs the full Install Preview and returns its result in one call: it stages the install (nothing reaches the device), renders the CLI it would push, then releases the staged copy. Staging is also where an uninstallable package fails -- e.g. a normalized interface with no mapping for a device -- so a failed preview returns the FortiManager task lines explaining why.

Changed in 1.13.0: the call now blocks until the preview is finished (up to timeout, default 300 s) and returns the per-device CLI directly; it used to return a task id at once, to be followed by wait_for_task and get_preview_result. On older builds (7.0-7.6.6, 8.0.0-8.0.1) it still works that way, with a warning: those builds cannot tie the preview to the named package without risking another administrator's install wizard (see utils/install_preview.py).

A successful package preview also authorizes one install_package of the same ADOM/package/devices (FMG_INSTALL_SAFETY gate); with package=None it authorizes one install_device_settings of the same ADOM/devices instead. A preview that finds nothing to install does not: there is nothing to push. Starting a preview drops any earlier preview of the same target, so only the latest attempt can authorize.

Args: adom: ADOM name package: Policy package name, or None to preview pending device settings (what install_device_settings would push) devices: Target devices [{"name": "FGT1", "vdom": "root"}, ...] timeout: Wall-clock budget in seconds for the whole preview (default 300, min 30, max 900)

Returns: dict: status; staged (whether the full preview ran); task_id (the render task); staging_task_id; devices: [{"name", "has_changes", "preview"}] where preview is the FortiOS CLI the install would send (credentials redacted); message. task_lines when FortiManager found nothing to install. warning when the staged copy could not be released (the devices may stay held; it says how to release them) or on an older build. On a failed step: status "error", error "preview_failed", step, task_lines with FortiManager's reason, and release_warning if the release failed too.

Example: >>> result = await preview_install( ... adom="root", ... package="default", ... devices=[{"name": "FGT-HQ", "vdom": "root"}], ... ) >>> for dev in result["devices"]: ... print(dev["name"], dev["preview"])

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>",
      "devices": "<devices>"
    },
    "name": "preview_install"
  }
}

Input Schema

NameRequiredDescriptionDefault
adomYes
devicesYes
packageYes
timeoutNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.13.1
    • addedInput schema / properties / package / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedInput schema / properties / package / type
      Removed value: -"string"
    • addedInput schema / properties / timeout
      Added value: +{
      +  "default": 300,
      +  "title": "Timeout",
      +  "type": "integer"
      +}
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and delivers: staging means nothing reaches the device, blocking behavior and timeout budget, the 1.13.0 change from task-id to direct CLI, older-build fallback with a warning, and the release-failure path that may leave devices held. This is unusually rich disclosure for a mutation-adjacent operation.

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, then behavior, then args/returns/example — a sensible order. It is long, including a version-changelog paragraph and a full code example, but nearly every sentence carries decision-relevant information; the changelog sentence is the weakest candidate for trimming.

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 staged, stateful, version-dependent operation, the description covers failure modes (preview_failed with task_lines, release_warning), warning conditions, and the authorization side effect. Nothing an agent needs in order to call it safely is missing; return-value detail is redundant against the output schema but not harmful.

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 0%, so the description must compensate. It does for package (None semantics), devices (explicit dict example), and timeout (default 300, min 30, max 900), but adom is only glossed as 'ADOM name', adding little. Strong overall compensation with one thin spot.

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: 'Preview what installing a policy package (or device settings) would push.' The parenthetical scope covering device settings immediately distinguishes it from install_package and install_device_settings.

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

Usage Guidelines5/5

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

Explicitly ties package=None to the install_device_settings path, explains the FMG_INSTALL_SAFETY authorization relationship to the install tools, and notes that a no-op preview authorizes nothing and that a new preview invalidates the prior one. An agent knows exactly when this preview is valid to call and what it enables downstream.

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