Skip to main content
Glama
FortiManager MCP Server

FortiManager MCP Server

by rstierli

diff_device_revision

Compare a past device DB revision against the current configuration and return a unified line diff, with optional section filtering for focused, read-only change review.

Instructions

Diff a past device DB revision against the CURRENT device DB.

FortiManager has no native diff endpoint for device DB revisions (unlike ADOM DB revisions -- see diff_adom_revision). This instead fetches both the past revision's config text (checkout) and the current device DB export, then computes a client-side unified line diff. Read-only.

Note: The checkout half of this requires the device to have at least one device DB revision on record -- see the note on list_device_revisions.

Args: device: Managed device name revision: Revision number to compare against current (see list_device_revisions) sections: Only compare these config blocks, e.g. ["router bgp", "system interface"] (the leading "config " is optional). A block matches at any depth, so "router bgp" also finds it under a VDOM. A full diff can reach hundreds of KB, because a revision also lists default objects the current export omits.

Both sides are normalised before diffing: trailing whitespace, blank lines and # header lines (config-version, build number) are dropped, since the checkout and the current export differ in them without any configuration change.

Returns: dict: status, device, revision, changed (bool), diff (unified diff text, empty string if unchanged), and with sections also sections_missing (requested sections found on neither side). Both sides are redacted of known secret-bearing directives before diffing -- see redact_config_text_secrets -- so a line whose only change is its secret value will not show as changed.

Example: >>> result = await diff_device_revision("hub2", revision=7) >>> if result["changed"]: ... print(result["diff"])

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": {
      "device": "<device>",
      "revision": "<revision>"
    },
    "name": "diff_device_revision"
  }
}

Input Schema

NameRequiredDescriptionDefault
deviceYes
revisionYes
sectionsNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.13.1
    • addedInput schema / properties / sections
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Sections"
      +}
  2. 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, the description carries the full burden and does so thoroughly: it declares read-only, explains the client-side checkout-plus-export diff mechanism, discloses normalization (trailing whitespace, blank lines, header lines dropped), warns that diffs can reach hundreds of KB, and notes secret redaction that can mask changes. This is unusually rich behavioral disclosure.

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 the core purpose and the sibling distinction, then structured into Note/Args/Returns/Example. It is somewhat long, but nearly every sentence adds actionable detail; minor verbosity in the sections explanation is the only cost.

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?

Despite an output schema existing, the description still explains the return shape (status, changed, diff, sections_missing) and the redaction caveat that affects interpretation. Combined with the prerequisite and normalization notes, an agent has everything needed to call and interpret it correctly.

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: device is the managed device name, revision is the number to compare against current, and sections is explained with examples, optional 'config ' prefix, and depth-matching semantics. It adds meaning well beyond the bare 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?

States a specific verb and resource ('Diff a past device DB revision against the CURRENT device DB') and explicitly distinguishes itself from the sibling diff_adom_revision, noting FortiManager has no native diff endpoint for device DB revisions. An agent can tell exactly what this does and how it differs from the ADOM variant.

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 context: use this for device DB revisions, use diff_adom_revision for ADOM DB revisions, and consult list_device_revisions for revision numbers. It also states the prerequisite that the device must have at least one revision on record. It stops short of explicit when-not-to-use exclusions, but the routing guidance 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