Skip to main content
Glama

netbox_get_objects

Retrieve NetBox objects by type and filters to query devices, IP addresses, sites, and other records with field selection, pagination, and ordering.

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: Lookups like {'name__ic': 'switch', 'id__in': [1,2,3], '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, in

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

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does most of it: it discloses pagination semantics, the default of 5 and max of 100, the exact paginated envelope (count/next/previous/results), and that field filtering uses NetBox's native ?fields= parameter. It never states read-only/safety expectations, authentication or permission requirements, or what happens on an invalid object_type or filter, which are the remaining behavioral gaps.

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 purpose and the key Args are front-loaded well, but the text is padded with repetitive all-caps imperatives (four near-identical "ALWAYS REFER TO THIS FIELD" lines) and duplicated warnings about the fields parameter. The ~130-entry object type list is long but earns its space because nothing in the schema enumerates it.

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?

For a 7-parameter, nested-object tool with no annotations and no output schema, the definition covers most of what an agent needs: valid types, filter grammar, field projection, pagination, and the response envelope. Remaining holes are sibling differentiation and any mention of permissions or failure modes.

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%, so the description must define all 7 parameters, and it does: object_type is backed by a full enumerated list of ~130 valid values (compensating for zero schema enums), filters gets concrete valid/invalid shapes plus the complete lookup-suffix vocabulary, and fields, brief, limit, offset and ordering each get examples and defaults. This adds substantial meaning the bare schema cannot 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 first line gives a specific verb and resource ("Get objects from NetBox based on their type and filters") and the Args block makes the scope concrete with real object_type examples like "dcim.device" and "ipam.ipaddress". It never distinguishes this from the sibling netbox_search_objects or netbox_get_object_by_id, so an agent must guess which of the three retrieval tools to pick.

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

Usage Guidelines4/5

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

Strong in-tool guidance: the "Two-step pattern for cross-relationship queries" with runnable examples tells the agent exactly how to work around the unsupported multi-hop filters, and the explicit "Invalid: Multi-hop like {'device__site_id': 1} - NOT supported" is a real when-not-to-use constraint. Missing is routing guidance against sibling retrieval tools (e.g., when to prefer netbox_search_objects), which keeps it from a 5.

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