Skip to main content
Glama

Ports Search Mac

ports_search_mac
Read-onlyIdempotent

Locate switch ports where a specific MAC address has been learned in LibreNMS forwarding tables, not port hardware MACs. Results rank by learned MAC count, surfacing the access port first.

Instructions

Find the switch ports where a MAC address was learned (forwarding table).

This searches LibreNMS's FDB data, i.e. where a host's MAC appears on the network, not the ports' own hardware addresses: a port's own MAC is not found unless another device learned it. Results are ordered by how many MACs each port has learned, so the access port the host is plugged into usually comes first.

Input Schema

NameRequiredDescriptionDefault
macYesMAC address of a host to locate (looked up in the forwarding tables, not ports' own MACs). Accepts aa:bb:cc:dd:ee:ff, aa-bb-cc-dd-ee-ff, aabb.ccdd.eeff, or aabbccddeeff
limitNoMaximum number of results to return
offsetNoNumber of results to skip (offset) for pagination

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.12.0
    • changedInput schema / properties / mac / description
      Previous value: -"MAC address to search. Accepts multiple formats: aa:bb:cc:dd:ee:ff, aa-bb-cc-dd-ee-ff, aabb.ccdd.eeff, or aabbccddeeff"New value: +"MAC address of a host to locate (looked up in the forwarding tables, not ports' own MACs). Accepts aa:bb:cc:dd:ee:ff, aa-bb-cc-dd-ee-ff, aabb.ccdd.eeff, or aabbccddeeff"
  2. Changed2 schema fields changedv1.10.3
    • addedInput schema / properties / limit
      Added value: +{
      +  "default": 100,
      +  "description": "Maximum number of results to return",
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / offset
      Added value: +{
      +  "default": 0,
      +  "description": "Number of results to skip (offset) for pagination",
      +  "minimum": 0,
      +  "type": "integer"
      +}
  3. First observedv1.9.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnly=true, idempotent=true, destructive=false, so safety is covered. The description goes further by disclosing a genuine behavioral trait: results are ordered by how many MACs each port has learned, so the access port usually ranks first. That ordering insight is not derivable from annotations or schema.

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 core action and the key caveat are front-loaded in the first sentence, with supporting detail after. It is mildly verbose but each sentence contributes useful disambiguation or ordering context, so nothing is wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present and full parameter coverage, the description does not need to explain return values. It covers the central gotcha and ordering behavior, leaving only the sibling-routing question (vs fdb_lookup/port_fdb) unaddressed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents mac, limit, and offset with accepted formats. The description reinforces the 'not ports' own MACs' caveat but adds no new syntax or constraint beyond the schema, making the baseline 3 appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource (find switch ports where a MAC was learned) and names the underlying data source (LibreNMS FDB). It sharply distinguishes itself from the intuitive misreading (ports' own hardware MACs), though it does not explicitly differentiate itself from nearby siblings like fdb_lookup or port_fdb.

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

Usage Guidelines3/5

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

Usage is implied by the framing 'where a host's MAC appears on the network', which tells the agent the lookup context. However, there is no explicit when-to-use/when-not and no pointer to alternatives such as fdb_lookup or device_fdb, so routing relies on inference.

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