Skip to main content
Glama
jseifeddine

NetBox MCP Server

by jseifeddine

netbox_get_object_by_id

Retrieve detailed information about specific network infrastructure objects in NetBox using their unique ID and type, such as devices, IP addresses, or sites.

Instructions

Get detailed information about a specific NetBox object by its ID.

Args: object_type: String representing the NetBox object type (e.g. "devices", "ip-addresses") object_id: The numeric ID of the object

Returns: Complete object details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
object_idYes
object_typeYes

Implementation Reference

  • The core handler function for the 'netbox_get_object_by_id' MCP tool. It is registered via the @mcp.tool() decorator, validates the object_type against supported NetBox types, constructs the REST API endpoint, and fetches the specific object by ID using the NetBox client.
    @mcp.tool() def netbox_get_object_by_id(object_type: str, object_id: int): """ Get detailed information about a specific NetBox object by its ID. Args: object_type: String representing the NetBox object type (e.g. "devices", "ip-addresses") object_id: The numeric ID of the object Returns: Complete object details """ # Validate object_type exists in mapping if object_type not in NETBOX_OBJECT_TYPES: valid_types = "\n".join(f"- {t}" for t in sorted(NETBOX_OBJECT_TYPES.keys())) raise ValueError(f"Invalid object_type. Must be one of:\n{valid_types}") # Get API endpoint from mapping endpoint = f"{NETBOX_OBJECT_TYPES[object_type]}/{object_id}" return netbox.get(endpoint)
  • The JSON schema defining the input parameters and structure for the 'netbox_get_object_by_id' tool, used by the LLM chatbot to invoke the tool correctly with object_type (string) and object_id (integer).
    "type": "function", "function": { "name": "netbox_get_object_by_id", "description": "Get detailed information about a specific NetBox object by its ID.", "parameters": { "type": "object", "properties": { "object_type": { "type": "string", "description": "Type of NetBox object" }, "object_id": { "type": "integer", "description": "The numeric ID of the object" } }, "required": ["object_type", "object_id"] } } },

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/jseifeddine/netbox-mcp-chatbot'

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