Skip to main content
Glama
FortiManager MCP Server

FortiManager MCP Server

by rstierli

query_device_api

Read a FortiOS REST API path on a managed device through FortiManager to retrieve live monitor state or running configuration, with no direct route or credentials needed.

Instructions

Read a diagnostic FortiOS REST API path on a managed device through FortiManager.

Proxies a GET through /sys/proxy/json, so the device needs no direct route or credentials. Use it for what no dedicated tool covers: live state from monitor paths, the running configuration from cmdb paths.

Read-only: only GET is sent, and only to an allowlist of paths (each with everything below it): monitor system status/resource/interface/ ha-peer/dhcp/link-monitor, router (ipv4, lookup, bgp, ospf, ...), network arp/lldp, firewall session/policy hit counts, vpn ipsec/ssl, virtual-wan, switch-controller managed-switch/status and detected-device, wifi clients and APs, user device/firewall; cmdb firewall, router, system interface/zone/sdwan/ ha/global/dns/snmp, vpn.ipsec, switch-controller, wireless-controller, user group and the security profiles. Anything else, and every file export or dump, is refused with the full list. Secrets are redacted by field name and value, SNMP community strings included, and params accepts the listed query parameters only.

Args: path: API path without query string, e.g. /api/v2/monitor/router/ipv4 or /api/v2/cmdb/firewall/address device: Managed device name. Defaults to DEFAULT_DEVICE when omitted. adom: ADOM name (default: DEFAULT_ADOM or "root") vdom: VDOM to query (default: the device's own default) params: Query parameters, from: count, datasource, destination, exclude-default-values, filter, format, include_vlan, ip_version, key, pattern, scope, skip, sort, source, start, summary, with_meta. Use count and format to keep large tables small, e.g. {"count": 50, "format": "name|subnet"}. filter applies to cmdb paths; monitor/firewall/session ignores it and takes source or destination.

    The row selectors ``filter``, ``key``, ``pattern`` and ``sort``
    are refused where they could reveal what the response hides: on
    SNMP community tables (any ``community``/``snmp-community``
    segment, anything under ``system.snmp``), on a field whose name
    marks a secret (``filter=password=@a``), and entirely while
    output masking is on, since a substring match or a sort on an
    address field recovers a masked address one query at a time.
    ``filter`` must be ``field<op>value`` clauses joined by commas
    (ops ``==``, ``!=``, ``=@``, ``!@``, ``<``, ``<=``, ``>``,
    ``>=``); a comma inside a value is refused, not guessed at.
    ``source``/``destination`` stay available with masking on: they
    take one whole address, the same exact lookup
    ``get_device_client_location`` accepts.

Returns: dict with keys: - adom, device, path - http_status, version, build: as reported by the device - results: the device's answer, secrets redacted - error / error_code: on failure

Example: >>> await query_device_api("/api/v2/monitor/router/bgp/neighbors", "branch1")

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": {
      "path": "<path>"
    },
    "name": "query_device_api"
  }
}

Input Schema

NameRequiredDescriptionDefault
adomNo
pathYes
vdomNo
deviceNo
paramsNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.13.1

TDQS

A4.9/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 behavioral burden and does so thoroughly: GET-only read behavior, proxying through /sys/proxy/json, allowlist enforcement, secret redaction, output masking interactions, and which row selectors are refused. It also explains why certain filters are blocked, which is important safety and permission context.

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 front-loaded and well structured with Args, Returns, and Example sections, and nearly all content is relevant to correct invocation. It is still quite long and dense, especially the enumerated allowlist and filter restriction paragraph, so it is thorough rather than maximally concise.

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 complex proxy tool with five parameters, zero schema coverage, and an output schema, the description is complete: it covers purpose, constraints, defaults, parameter meanings, redaction behavior, and failure keys. An agent has enough information to call it correctly without needing additional documentation.

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 compensate, and it does: path examples, device/adom/vdom defaults, and a full list of accepted params keys with usage notes. It further explains filter syntax, source/destination behavior, and restrictions that are not represented in the 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: it reads a diagnostic FortiOS REST API path through FortiManager. It also distinguishes this tool from dedicated siblings by saying to use it only for what no dedicated tool covers, citing monitor and cmdb paths as examples.

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?

It gives explicit when-to-use guidance: live monitor state or running cmdb configuration when no dedicated tool exists. It also gives when-not-to-use guidance via the allowlist refusal behavior, and it points to get_device_client_location for the exact source/destination lookup case.

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