Skip to main content
Glama
JLKmach

ServiceNow MCP Server

by JLKmach

get_changeset_details

Retrieve detailed information about a specific ServiceNow changeset using its ID, including status, changes, and related data for tracking and analysis.

Instructions

Get detailed information about a specific changeset

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
changeset_idYesChangeset ID or sys_id

Implementation Reference

  • The core handler function that retrieves detailed information about a specific changeset by querying the ServiceNow API for both the changeset and its associated changes.
    def get_changeset_details(
        auth_manager: AuthManager,
        server_config: ServerConfig,
        params: Union[Dict[str, Any], GetChangesetDetailsParams],
    ) -> Dict[str, Any]:
        """
        Get detailed information about a specific changeset.
    
        Args:
            auth_manager: The authentication manager.
            server_config: The server configuration.
            params: The parameters for getting changeset details. Can be a dictionary or a GetChangesetDetailsParams object.
    
        Returns:
            Detailed information about the changeset.
        """
        # Unwrap and validate parameters
        result = _unwrap_and_validate_params(
            params, 
            GetChangesetDetailsParams, 
            required_fields=["changeset_id"]
        )
        
        if not result["success"]:
            return result
        
        validated_params = result["params"]
        
        # Get the instance URL
        instance_url = _get_instance_url(auth_manager, server_config)
        if not instance_url:
            return {
                "success": False,
                "message": "Cannot find instance_url in either server_config or auth_manager",
            }
        
        # Get the headers
        headers = _get_headers(auth_manager, server_config)
        if not headers:
            return {
                "success": False,
                "message": "Cannot find get_headers method in either auth_manager or server_config",
            }
        
        # Make the API request
        url = f"{instance_url}/api/now/table/sys_update_set/{validated_params.changeset_id}"
        
        try:
            response = requests.get(url, headers=headers)
            response.raise_for_status()
            
            result = response.json()
            
            # Get the changeset details
            changeset = result.get("result", {})
            
            # Get the changes in this changeset
            changes_url = f"{instance_url}/api/now/table/sys_update_xml"
            changes_params = {
                "sysparm_query": f"update_set={validated_params.changeset_id}",
            }
            
            changes_response = requests.get(changes_url, params=changes_params, headers=headers)
            changes_response.raise_for_status()
            
            changes_result = changes_response.json()
            changes = changes_result.get("result", [])
            
            return {
                "success": True,
                "changeset": changeset,
                "changes": changes,
                "change_count": len(changes),
            }
        except requests.exceptions.RequestException as e:
            logger.error(f"Error getting changeset details: {e}")
            return {
                "success": False,
                "message": f"Error getting changeset details: {str(e)}",
            }
  • Pydantic BaseModel defining the input schema for the get_changeset_details tool, requiring a changeset_id.
    class GetChangesetDetailsParams(BaseModel):
        """Parameters for getting changeset details."""
    
        changeset_id: str = Field(..., description="Changeset ID or sys_id")
  • Registration of the tool in the central get_tool_definitions dictionary, mapping the tool name to its implementation, params schema, description, and serialization details.
    "get_changeset_details": (
        get_changeset_details_tool,
        GetChangesetDetailsParams,
        str,  # Expects JSON string
        "Get detailed information about a specific changeset",
        "json",  # Tool returns list/dict
    ),
  • Import and alias of the handler function for use in tool registration.
    from servicenow_mcp.tools.changeset_tools import (
        get_changeset_details as get_changeset_details_tool,
    )
  • Export of the tool function via __init__.py to make it available in the tools namespace.
    get_changeset_details,
Behavior2/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 of behavioral disclosure. While 'Get' implies a read-only operation, it doesn't specify whether this requires specific permissions, what format the detailed information includes (e.g., JSON structure, fields), or any rate limits or side effects. For a tool with no annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any wasted words. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly. Every part of the sentence earns its place by conveying essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity implied by sibling tools (e.g., many CRUD operations) and the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'detailed information' includes, how it differs from other get/list tools, or any behavioral aspects like error handling. For a tool in this context, more guidance is needed to be fully helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the single parameter 'changeset_id' clearly documented as 'Changeset ID or sys_id'. The description adds no additional parameter semantics beyond this, so it meets the baseline of 3 where the schema does the heavy lifting. However, it doesn't compensate for any gaps since there are none.

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 with a specific verb ('Get') and resource ('detailed information about a specific changeset'), making it immediately understandable. However, it doesn't distinguish this tool from potential alternatives like 'get_change_request_details' or 'list_changesets' among the many sibling tools, which would require explicit differentiation for a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like 'list_changesets' and 'get_change_request_details' available, there's no indication whether this tool is for retrieving metadata, status, or other details, or what prerequisites might be needed (e.g., authentication level). This lack of context leaves the agent guessing about appropriate usage scenarios.

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/JLKmach/servicenow-mcp'

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