Skip to main content
Glama
alexkiwi1

NetBox MCP Server - Read & Write Edition

by alexkiwi1

netbox_get_changelogs

Retrieve and filter NetBox object change records to track modifications, audit activities, and monitor system updates using customizable criteria.

Instructions

Get object change records (changelogs) from NetBox based on filters.

Args: filters: dict of filters to apply to the API call based on the NetBox API filtering options

Returns: List of changelog objects matching the specified filters

Filtering options include:

  • user_id: Filter by user ID who made the change

  • user: Filter by username who made the change

  • changed_object_type_id: Filter by ContentType ID of the changed object

  • changed_object_id: Filter by ID of the changed object

  • object_repr: Filter by object representation (usually contains object name)

  • action: Filter by action type (created, updated, deleted)

  • time_before: Filter for changes made before a given time (ISO 8601 format)

  • time_after: Filter for changes made after a given time (ISO 8601 format)

  • q: Search term to filter by object representation

Example: To find all changes made to a specific device with ID 123: {"changed_object_type_id": "dcim.device", "changed_object_id": 123}

To find all deletions in the last 24 hours: {"action": "delete", "time_after": "2023-01-01T00:00:00Z"}

Each changelog entry contains:

  • id: The unique identifier of the changelog entry

  • user: The user who made the change

  • user_name: The username of the user who made the change

  • request_id: The unique identifier of the request that made the change

  • action: The type of action performed (created, updated, deleted)

  • changed_object_type: The type of object that was changed

  • changed_object_id: The ID of the object that was changed

  • object_repr: String representation of the changed object

  • object_data: The object's data after the change (null for deletions)

  • object_data_v2: Enhanced data representation

  • prechange_data: The object's data before the change (null for creations)

  • postchange_data: The object's data after the change (null for deletions)

  • time: The timestamp when the change was made

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filtersYes

Implementation Reference

  • The handler function implementing the 'netbox_get_changelogs' tool logic. It uses the global 'netbox' client to query the NetBox API's 'core/object-changes' endpoint with the provided filters. The @mcp.tool() decorator also serves as the registration for this MCP tool.
    @mcp.tool()
    def netbox_get_changelogs(filters: dict):
        """
        Get object change records (changelogs) from NetBox based on filters.
        
        Args:
            filters: dict of filters to apply to the API call based on the NetBox API filtering options
        
        Returns:
            List of changelog objects matching the specified filters
        
        Filtering options include:
        - user_id: Filter by user ID who made the change
        - user: Filter by username who made the change
        - changed_object_type_id: Filter by ContentType ID of the changed object
        - changed_object_id: Filter by ID of the changed object
        - object_repr: Filter by object representation (usually contains object name)
        - action: Filter by action type (created, updated, deleted)
        - time_before: Filter for changes made before a given time (ISO 8601 format)
        - time_after: Filter for changes made after a given time (ISO 8601 format)
        - q: Search term to filter by object representation
    
        Example:
        To find all changes made to a specific device with ID 123:
        {"changed_object_type_id": "dcim.device", "changed_object_id": 123}
        
        To find all deletions in the last 24 hours:
        {"action": "delete", "time_after": "2023-01-01T00:00:00Z"}
        
        Each changelog entry contains:
        - id: The unique identifier of the changelog entry
        - user: The user who made the change
        - user_name: The username of the user who made the change
        - request_id: The unique identifier of the request that made the change
        - action: The type of action performed (created, updated, deleted)
        - changed_object_type: The type of object that was changed
        - changed_object_id: The ID of the object that was changed
        - object_repr: String representation of the changed object
        - object_data: The object's data after the change (null for deletions)
        - object_data_v2: Enhanced data representation
        - prechange_data: The object's data before the change (null for creations)
        - postchange_data: The object's data after the change (null for deletions)
        - time: The timestamp when the change was made
        """
        endpoint = "core/object-changes"
        
        # Make API call
        return netbox.get(endpoint, params=filters)
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It effectively discloses behavioral traits: it's a read operation (implied by 'Get'), returns a list of changelog objects, details the structure of each entry (e.g., id, user, action, time), and includes filtering capabilities. However, it does not mention potential limitations like rate limits, authentication needs, or pagination, which are relevant for API tools.

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 with clear sections (Args, Returns, Filtering options, Example, entry details) and front-loaded purpose. It is appropriately sized for the complexity, but could be slightly more concise by integrating some details (e.g., entry fields) into a more streamlined format without losing clarity.

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?

Given the tool's complexity (filtering changelogs), no annotations, no output schema, and 0% schema coverage, the description is largely complete. It covers purpose, parameters with examples, return format, and entry details. However, it lacks information on error handling, pagination, or authentication, which are common in API contexts, leaving minor gaps.

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 description coverage is 0%, with only one parameter ('filters') documented minimally in the schema. The description compensates fully by detailing filtering options (e.g., user_id, action, time_before), providing examples of filter usage, and explaining the parameter's role in the API call. This adds significant meaning beyond the basic schema.

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 description clearly states the tool's purpose: 'Get object change records (changelogs) from NetBox based on filters.' It specifies the verb ('Get'), resource ('object change records'), and scope ('from NetBox based on filters'), but does not explicitly differentiate it from sibling tools like 'netbox_get_objects' or 'netbox_get_object_by_id' beyond the changelog focus.

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

Usage Guidelines3/5

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

The description implies usage for retrieving changelogs with filtering, but does not explicitly state when to use this tool versus alternatives like 'netbox_get_objects' for current data. It provides example use cases (e.g., finding changes to a device or deletions in a time range), which offer some contextual guidance, but lacks direct comparisons or exclusions.

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/alexkiwi1/netbox-mcp-rw'

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