Usage Examples - randygagnon/netbox-mcp-server GitHub Wiki

Usage Examples

This guide provides practical examples of using the NetBox MCP Server with various LLM clients.

Common Queries

Infrastructure Discovery

  1. List all sites

    What sites do we have in NetBox?
    
  2. Find devices in a specific site

    Show me all devices in the London datacenter
    
  3. Get rack information

    List all racks in DC1 that are less than 80% utilized
    

IP Management

  1. IP Address Usage

    Show me all IP addresses in the 10.0.0.0/8 network
    
  2. VLAN Information

    What VLANs are configured in the production environment?
    
  3. Prefix Utilization

    Show me utilization of all IPv4 prefixes
    

Device Management

  1. Device Search

    Find all Cisco switches in the network
    
  2. Interface Status

    Show me all interfaces on device core-switch-01
    
  3. Hardware Inventory

    List all devices with serial numbers and purchase dates
    

Circuit Management

  1. Provider Information

    Show me all circuits from provider AT&T
    
  2. Circuit Capacity

    List circuits with utilization over 80%
    

Virtualization

  1. VM Inventory

    Show all virtual machines running on cluster prod-cluster-01
    
  2. Resource Usage

    List VMs with more than 8 CPUs and 16GB RAM
    

Advanced Usage

Complex Filtering

  1. Multi-criteria Search

    Find all devices that are:
    - Manufactured by Cisco
    - Located in the NYC datacenter
    - Have 10G interfaces
    
  2. Status-based Queries

    Show me all devices that are:
    - Currently active
    - Have maintenance due in the next 30 days
    - Are running IOS version 15.x
    

Reporting Queries

  1. Capacity Planning

    Generate a report showing:
    - Rack space utilization per site
    - Power consumption trends
    - Network interface utilization
    
  2. Asset Management

    List all devices with:
    - Purchase date
    - Warranty status
    - Support contract details
    

Network Analysis

  1. Connectivity Mapping

    Show me the network path between:
    - Source: web-server-01
    - Destination: db-server-02
    
  2. Security Zones

    List all devices in the DMZ with their:
    - IP addresses
    - Connected interfaces
    - Security group assignments
    

Write Operations

Creating Objects

  1. Create a new device

    Create a new device called "app-server-05" with device type "R640 Server", role "Application Server", and site "NYC"
    
  2. Add an IP address

    Add IP address 192.168.100.25/24 with description "New application server" and status "active"
    
  3. Create a new VLAN

    Create VLAN 200 named "Dev Environment" in VLAN group "Office" with status "active"
    

Updating Objects

  1. Update device status

    Change the status of device "core-switch-01" to "maintenance"
    
  2. Modify IP address description

    Update the description of IP 10.0.0.1/24 to "Primary Gateway"
    
  3. Add tags to devices

    Add tags "migration" and "2023-upgrade" to all devices in the London datacenter
    

Deleting Objects

  1. Remove a decommissioned device

    Delete device "old-server-03" from NetBox
    
  2. Clean up unused IP addresses

    Remove all IP addresses in prefix 192.168.50.0/24
    

Bulk Operations

  1. Create multiple IP addresses

    Create the following IP addresses in NetBox:
    - 10.10.10.1/24 with description "Router"
    - 10.10.10.2/24 with description "Core Switch"
    - 10.10.10.3/24 with description "Firewall"
    
  2. Update status of multiple devices

    Change the status of all devices in rack R101 to "active"
    

Best Practices

  1. Be Specific

    • Include relevant details in your queries
    • Use exact names when known
    • Specify filters clearly
  2. Use Natural Language

    • Queries can be written in plain English
    • No need for special syntax
    • The LLM will interpret your intent
  3. Iterative Refinement

    • Start with broad queries
    • Refine based on results
    • Ask follow-up questions

Troubleshooting Queries

  1. Validation

    Verify the configuration of device core-switch-01
    
  2. Connectivity

    Show me all connections to server web-01
    
  3. Audit

    List all changes made to the network in the past week
    

For more detailed API information, see the API Reference page.