Skip to main content
Glama
NetBox MCP Server

NetBox MCP Server

Official
by netboxlabs

netbox_get_objects

Read-only

Query NetBox objects by object type and API filters, selecting specific fields to reduce response size and token usage.

Instructions

Get objects from NetBox based on their type and filters

Args:
    object_type: String representing the NetBox object type (e.g. "dcim.device", "ipam.ipaddress")
    filters: dict of filters to apply to the API call based on the NetBox API filtering options

            FILTER RULES:
            Valid: Direct fields like {'site_id': 1, 'name': 'router', 'status': 'active'}
            Valid: Field-supported lookups like {'name__ic': 'switch', 'vid__gte': 100}
            Invalid: Multi-hop like {'device__site_id': 1} - NOT supported

            Lookup suffixes: n, ic, nic, isw, nisw, iew, niew, ie, nie,
                             empty, regex, iregex, lt, lte, gt, gte
            Lookup support is field-specific. NetBox may silently ignore unsupported
            lookups and return overly broad results. The '__in' suffix is not supported
            and is rejected by this tool. For multiple values, pass a list as the field
            value directly: {'vminterface_id': [621493, 631527]} or {'id': [1, 2, 3]}.

            Two-step pattern for cross-relationship queries:
              sites = netbox_get_objects('dcim.site', {'name': 'NYC'})
              netbox_get_objects('dcim.device', {'site_id': sites['results'][0]['id']})

    fields: Optional list of specific fields to return
            **IMPORTANT: ALWAYS USE THIS PARAMETER TO MINIMIZE TOKEN USAGE**
            Field filtering significantly reduces response payload and is critical for performance.

            - None or [] = returns all fields (NOT RECOMMENDED - use only when you need complete objects)
            - ['id', 'name'] = returns only specified fields (RECOMMENDED)

            Examples:
            - For counting: ['id'] (minimal payload)
            - For listings: ['id', 'name', 'status']
            - For IP addresses: ['address', 'dns_name', 'description']

            Uses NetBox's native field filtering via ?fields= parameter.
            **Always specify only the fields you actually need.**

    brief: returns only a minimal representation of each object in the response.
           This is useful when you need only a list of available objects without any related data.

    limit: Maximum results to return (default 5, max 100)
           Start with default, increase only if needed

    offset: Skip this many results for pagination (default 0)
            Example: offset=0 (page 1), offset=5 (page 2), offset=10 (page 3)

    ordering: Fields used to determine sort order of results.
              Field names may be prefixed with '-' to invert the sort order.
              Multiple fields may be specified with a list of strings.

              Examples:
              - 'name' (alphabetical by name)
              - '-id' (ordered by ID descending)
              - ['facility', '-name'] (by facility, then by name descending)
              - None, '' or [] (default NetBox ordering)


Returns:
    Paginated response dict with the following structure:
        - count: Total number of objects matching the query
                 ALWAYS REFER TO THIS FIELD FOR THE TOTAL NUMBER OF OBJECTS MATCHING THE QUERY
        - next: URL to next page (or null if no more pages)
                ALWAYS REFER TO THIS FIELD FOR THE NEXT PAGE OF RESULTS
        - previous: URL to previous page (or null if on first page)
                    ALWAYS REFER TO THIS FIELD FOR THE PREVIOUS PAGE OF RESULTS
        - results: Array of objects for this page
                   ALWAYS REFER TO THIS FIELD FOR THE OBJECTS ON THIS PAGE

ENSURE YOU ARE AWARE THE RESULTS ARE PAGINATED BEFORE PROVIDING RESPONSE TO THE USER.

Valid object_type values:

- circuits.circuit
  • circuits.circuitgroup

  • circuits.circuitgroupassignment

  • circuits.circuittermination

  • circuits.circuittype

  • circuits.provider

  • circuits.provideraccount

  • circuits.providernetwork

  • circuits.virtualcircuit

  • circuits.virtualcircuittermination

  • circuits.virtualcircuittype

  • core.datafile

  • core.datasource

  • core.job

  • core.objectchange

  • core.objecttype

  • dcim.cable

  • dcim.cabletermination

  • dcim.consoleport

  • dcim.consoleporttemplate

  • dcim.consoleserverport

  • dcim.consoleserverporttemplate

  • dcim.device

  • dcim.devicebay

  • dcim.devicebaytemplate

  • dcim.devicerole

  • dcim.devicetype

  • dcim.frontport

  • dcim.frontporttemplate

  • dcim.interface

  • dcim.interfacetemplate

  • dcim.inventoryitem

  • dcim.inventoryitemrole

  • dcim.inventoryitemtemplate

  • dcim.location

  • dcim.macaddress

  • dcim.manufacturer

  • dcim.module

  • dcim.modulebay

  • dcim.modulebaytemplate

  • dcim.moduletype

  • dcim.moduletypeprofile

  • dcim.platform

  • dcim.powerfeed

  • dcim.poweroutlet

  • dcim.poweroutlettemplate

  • dcim.powerpanel

  • dcim.powerport

  • dcim.powerporttemplate

  • dcim.rack

  • dcim.rackreservation

  • dcim.rackrole

  • dcim.racktype

  • dcim.rearport

  • dcim.rearporttemplate

  • dcim.region

  • dcim.site

  • dcim.sitegroup

  • dcim.virtualchassis

  • dcim.virtualdevicecontext

  • extras.bookmark

  • extras.configcontext

  • extras.configcontextprofile

  • extras.configtemplate

  • extras.customfield

  • extras.customfieldchoiceset

  • extras.customlink

  • extras.eventrule

  • extras.exporttemplate

  • extras.imageattachment

  • extras.journalentry

  • extras.notification

  • extras.notificationgroup

  • extras.savedfilter

  • extras.script

  • extras.subscription

  • extras.tableconfig

  • extras.tag

  • extras.taggeditem

  • extras.webhook

  • ipam.aggregate

  • ipam.asn

  • ipam.asnrange

  • ipam.fhrpgroup

  • ipam.fhrpgroupassignment

  • ipam.ipaddress

  • ipam.iprange

  • ipam.prefix

  • ipam.rir

  • ipam.role

  • ipam.routetarget

  • ipam.service

  • ipam.servicetemplate

  • ipam.vlan

  • ipam.vlangroup

  • ipam.vlantranslationpolicy

  • ipam.vlantranslationrule

  • ipam.vrf

  • tenancy.contact

  • tenancy.contactassignment

  • tenancy.contactgroup

  • tenancy.contactrole

  • tenancy.tenant

  • tenancy.tenantgroup

  • users.group

  • users.objectpermission

  • users.owner

  • users.ownergroup

  • users.token

  • users.user

  • virtualization.cluster

  • virtualization.clustergroup

  • virtualization.clustertype

  • virtualization.virtualdisk

  • virtualization.virtualmachine

  • virtualization.vminterface

  • vpn.ikepolicy

  • vpn.ikeproposal

  • vpn.ipsecpolicy

  • vpn.ipsecprofile

  • vpn.ipsecproposal

  • vpn.l2vpn

  • vpn.l2vpntermination

  • vpn.tunnel

  • vpn.tunnelgroup

  • vpn.tunneltermination

  • wireless.wirelesslan

  • wireless.wirelesslangroup

  • wireless.wirelesslink

    See NetBox API documentation for filtering options for each object type.

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": {
      "object_type": "<object_type>",
      "filters": "<filters>"
    },
    "name": "netbox_get_objects"
  }
}

Input Schema

NameRequiredDescriptionDefault
briefNo
limitNo
fieldsNo
offsetNo
filtersYes
orderingNo
object_typeYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.1

TDQS

A4.2/5.0
Behavior5/5

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

Beyond the readOnlyHint annotation, the description discloses several non-obvious behaviors: results are always paginated, unsupported lookup suffixes may be silently ignored producing overly broad results, '__in' is rejected outright, and limit is capped at 5 by default with a max of 100. The explicit warning 'ENSURE YOU ARE AWARE THE RESULTS ARE PAGINATED' and the full envelope structure (count/next/previous/results) go well past what the annotation provides.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The Args/Returns/valid-values organization is sound and the purpose is front-loaded, but there is significant redundancy: the fields parameter is hammered with 'IMPORTANT: ALWAYS USE THIS PARAMETER' followed by '**Always specify only the fields you actually need.**', and the 'ALWAYS REFER TO THIS FIELD' refrain is repeated four times in the Returns block. The ~120-item object_type list is long but justified since the schema declares no enum, so the bloat is mainly the repeated emphasis rather than the reference data.

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?

With no output schema, the description correctly documents the paginated return envelope and each of its fields. All seven parameters are explained, required vs optional is clear, and the hazards an agent would otherwise hit (pagination, silently ignored filters, token-heavy unfiltered responses) are called out, so nothing needed to call this tool correctly is missing.

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 carry the full burden, and it does: object_type gets example values plus an exhaustive valid-type list, filters gets lookup-suffix rules, valid/invalid examples, and the list-for-multi-value idiom, and fields, brief, limit, offset, and ordering each get their own semantics and examples. The two-step cross-relationship pattern in particular adds meaning the bare schema could never convey.

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?

The description opens with a specific verb and resource: 'Get objects from NetBox based on their type and filters,' and the object_type list makes the scope concrete. It is clear what the tool does, but it never mentions the sibling tools netbox_search_objects or netbox_get_object_by_id, so the agent gets no explicit help deciding between this broad query tool and those alternatives.

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?

There is no explicit when-to-use/when-not-to-use guidance and no routing to sibling tools such as netbox_get_object_by_id or netbox_search_objects. Usage context is only implied by the heavy filter and fields guidance ('Start with default, increase only if needed', the cross-relationship two-step pattern), which tells the agent how to call it but not when this tool is the right choice.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.