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
| Name | Required | Description | Default |
|---|---|---|---|
| brief | No | ||
| limit | No | ||
| fields | No | ||
| offset | No | ||
| filters | Yes | ||
| ordering | No | ||
| object_type | Yes |