Skip to main content
Glama
netboxlabs

NetBox MCP Server

Official
by netboxlabs

netbox_get_objects

Retrieve NetBox objects by type and filters with paginated results. Use field filtering to minimize response size.

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[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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
briefNo
limitNo
fieldsNo
offsetNo
filtersYes
orderingNo
object_typeYes
Behavior5/5

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

No annotations are provided, so the description fully discloses behavior: it's a read operation returning paginated results, with default limit=5 and max=100. It warns about unsupported lookups being silently ignored, explains field filtering, and details the return structure (count, next, previous, results). The note about pagination is critical.

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 well-structured (Args, Returns, lists) and front-loaded with the core purpose. However, it is verbose, especially the long list of valid object_type values and repeated capitalization of 'ALWAYS REFER'. While comprehensive, it could be more concise without losing clarity.

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?

Given the tool's complexity (7 parameters, no output schema, no annotations), the description is remarkably complete. It covers every parameter, pagination, return structure, filter rules, and common pitfalls. Sibling tools exist but the description alone sufficiently defines the tool's domain.

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%, but the description compensates thoroughly by explaining each of the 7 parameters: object_type (with full list), filters (rules, lookups, examples), fields (importance, examples), brief, limit, offset, ordering (syntax, examples). It adds significant meaning beyond the bare schema types and constraints.

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 clearly states the tool's purpose: 'Get objects from NetBox based on their type and filters.' It uses a specific verb-resource pair, distinguishes from siblings like netbox_get_object_by_id (single object) and netbox_search_objects, and includes the scope of operation (listing/filtering).

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?

The description provides extensive usage guidelines: valid filter rules (direct fields, lookups), unsupported patterns (multi-hop, '__in'), two-step cross-relationship pattern, mandatory use of 'fields' parameter, pagination with limit/offset, ordering examples. It implicitly instructs when not to use this tool (e.g., for single objects, use get_object_by_id). Clear and actionable.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/netboxlabs/netbox-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server