Skip to main content
Glama
FortiManager MCP Server

FortiManager MCP Server

by rstierli

add_model_device

Adds a model device for offline provisioning, enabling policies, templates, and per-device values to be prepared before the FortiGate connects.

Instructions

Add a model device for offline provisioning.

Model devices allow pre-configuring policies and settings before the actual device connects to FortiManager. Useful for zero-touch provisioning workflows.

With device_blueprint the new device inherits what the blueprint defines (template group, policy package, groups, enforced firmware...), and meta_variables supplies the per-device values its templates reference as $(name) -- the same fields the GUI "Add Model Device" dialog sends. Nothing is pushed to a real FortiGate: a model device is a placeholder until a FortiGate with this serial registers.

API coverage: device blueprint, patch and the HA attributes (ha_mode, ha_group_name, ha_slave) are in the bundled dvmcmd schema (7.2 to 8.0), the HA ones flagged internal; a model HA cluster was verified on FortiManager 8.0.2. The meta variables key is not in the bundled API reference: it is what the 8.0 GUI sends, verified on FortiManager 8.0.2, where each entry becomes a "global" per-device mapping and a name the ADOM does not have yet is created as a new metadata variable with an empty default (so a misspelt name leaves a stray variable behind; check names with list_metadata_variables).

The add is refused if the ADOM already has a device with this name or serial number. Safety: a blueprint that sets a firmware template or prefer-img-ver binds the device to a firmware version FortiManager can install on the FortiGate when it registers (a reboot), so under FMG_FIRMWARE_SAFETY=strict (default) it needs confirm=True, as upgrade_device_firmware does. So does a saved blueprint that cannot be read to check.

Args: adom: ADOM name where device will be added name: Device display name serial_number: Device serial number (e.g., "FGVM020000123456"); checked against the FortiGate/Fortinet serial format platform: Platform type (default: "FortiGate-VM64") os_version: FortiOS version, "7.4" or with patch "7.4.12" (default: "7.0") description: Device description device_blueprint: Name of a saved device blueprint, or an inline blueprint object (what the GUI sends with the blueprint option unchecked), e.g. {"pkg": "branch_pkg", "prov-type": "template-group", "template-group": "branch_templates", "dev-group": ["emea_spokes"], "prerun-cliprof": "bootstrap"}. Attributes follow fmg/device/blueprint; every object it names (package, template group, device groups, templates, CLI and authorization templates, firmware template) is looked up first and the add is refused if one does not exist. A saved blueprint name is checked the same way. meta_variables: Per-device meta-variable values, e.g. {"hostname": "b1", "branch_id": "1", "port3": "192.0.2.1/24"}. Values are strings or numbers, at most 255 characters, with no newlines or other control characters and none of ", \, #, {{, {%, {# or $( (templates paste them into CLI as is). Password-type values are masked in the result groups: Device group names to add the device to (root VDOM) ha_mode: Declare a model HA cluster: "AP" (active-passive) or "AA". name/serial_number are then the primary member and the cluster's device name in FMG. ha_group_name: HA cluster group name (required with ha_mode, max 36 characters) ha_priority: HA priority of the primary member (default 128) ha_members: Secondary members, each {"name": "branch3-1", "serial_number": "FGVM...", "priority": 100} flags: dvm/cmd/add/device flags, e.g. ["create_task"] (the GUI sends ["create_task", "nonblocking"]); the task ID is returned confirm: Must be True to add from a blueprint that enforces a firmware version, under FMG_FIRMWARE_SAFETY=strict (default). Ignored when FMG_FIRMWARE_SAFETY=disabled.

Returns: dict: Add result with keys: - status: "success" or "error" - device: Added device information - message: Status or error message

Example: >>> result = await add_model_device( ... adom="root", ... name="FGT-NewBranch", ... serial_number="FGVM02TM12345678", ... platform="FortiGate-60F", ... os_version="7.4" ... )

>>> # From a blueprint, with the variables its templates use
>>> result = await add_model_device(
...     adom="demo",
...     name="branch1",
...     serial_number="FGVM020000123456",
...     platform="FortiGate-VM64-KVM",
...     os_version="7.4.12",
...     device_blueprint="branch_standalone_blueprint",
...     meta_variables={"hostname": "branch1", "branch_id": "1"},
... )

>>> # A two-member active-passive model cluster
>>> result = await add_model_device(
...     adom="demo",
...     name="branch3",
...     serial_number="FGVM020000123457",
...     platform="FortiGate-VM64-KVM",
...     os_version="7.4.12",
...     device_blueprint="branch_cluster_blueprint",
...     ha_mode="AP",
...     ha_group_name="branch3_cluster",
...     ha_priority=200,
...     ha_members=[{"name": "branch3-1",
...                  "serial_number": "FGVM020000123458", "priority": 100}],
... )

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>",
      "name": "<name>",
      "serial_number": "<serial_number>"
    },
    "name": "add_model_device"
  }
}

Input Schema

NameRequiredDescriptionDefault
adomYes
nameYes
flagsNo
groupsNo
confirmNo
ha_modeNo
platformNoFortiGate-VM64
ha_membersNo
os_versionNo7.0
descriptionNo
ha_priorityNo
ha_group_nameNo
serial_numberYes
meta_variablesNo
device_blueprintNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv1.13.1
    • addedInput schema / properties / confirm
      Added value: +{
      +  "default": false,
      +  "title": "Confirm",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / device_blueprint
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Device Blueprint"
      +}
    • addedInput schema / properties / flags
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Flags"
      +}
    • addedInput schema / properties / groups
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Groups"
      +}
    • addedInput schema / properties / ha_group_name
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Ha Group Name"
      +}
    • addedInput schema / properties / ha_members
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Ha Members"
      +}
    • addedInput schema / properties / ha_mode
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Ha Mode"
      +}
    • addedInput schema / properties / ha_priority
      Added value: +{
      +  "default": 128,
      +  "title": "Ha Priority",
      +  "type": "integer"
      +}
    • addedInput schema / properties / meta_variables
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Meta Variables"
      +}
  2. First observed

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral burden and does so thoroughly. It discloses duplicate-name/serial refusal, blueprint object validation, firmware safety confirm requirements, metadata-variable side effects, password masking, and that nothing is pushed to a real device.

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 long but front-loads the purpose and workflow context before the detailed Args section. Most of the length is justified by the 15 undocumented parameters and safety behavior, though some API-coverage discussion could be tighter.

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 15-parameter mutation tool with no annotations and no schema parameter descriptions, the definition is complete. It covers purpose, usage context, parameter semantics, refusal conditions, safety behavior, return shape, and examples.

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 supply parameter meaning, and it documents all 15 parameters in detail. It adds defaults, constraints, formats, nested object expectations, and examples for complex parameters such as device_blueprint, meta_variables, and ha_members.

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: add a model device for offline provisioning. It clearly explains that this creates a placeholder rather than a real FortiGate, which distinguishes it from tools that add actual devices.

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?

Gives clear when-to-use context by framing it around zero-touch provisioning and pre-configuring policies before a device connects. It also points to list_metadata_variables for name checks, but does not explicitly contrast it with the sibling add_device or add_devices_bulk tools.

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