Skip to main content
Glama
javerthl

ServiceNow MCP Server

by javerthl

update_changeset

Modify an existing ServiceNow changeset by updating its name, description, state, or assigned developer to reflect current requirements or progress.

Instructions

Update an existing changeset in ServiceNow

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
changeset_idYesChangeset ID or sys_id
descriptionNoDescription of the changeset
developerNoDeveloper responsible for the changeset
nameNoName of the changeset
stateNoState of the changeset

Implementation Reference

  • The main handler function that implements the update_changeset tool logic. It validates parameters using UpdateChangesetParams, prepares a PATCH request to the ServiceNow API endpoint /api/now/table/sys_update_set/{changeset_id}, and returns the updated changeset details.
    def update_changeset(
        auth_manager: AuthManager,
        server_config: ServerConfig,
        params: Union[Dict[str, Any], UpdateChangesetParams],
    ) -> Dict[str, Any]:
        """
        Update an existing changeset in ServiceNow.
    
        Args:
            auth_manager: The authentication manager.
            server_config: The server configuration.
            params: The parameters for updating a changeset. Can be a dictionary or a UpdateChangesetParams object.
    
        Returns:
            The updated changeset.
        """
        # Unwrap and validate parameters
        result = _unwrap_and_validate_params(
            params, 
            UpdateChangesetParams, 
            required_fields=["changeset_id"]
        )
        
        if not result["success"]:
            return result
        
        validated_params = result["params"]
        
        # Prepare the request data
        data = {}
        
        # Add optional fields if provided
        if validated_params.name:
            data["name"] = validated_params.name
        if validated_params.description:
            data["description"] = validated_params.description
        if validated_params.state:
            data["state"] = validated_params.state
        if validated_params.developer:
            data["developer"] = validated_params.developer
        
        # If no fields to update, return error
        if not data:
            return {
                "success": False,
                "message": "No fields to update",
            }
        
        # 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",
            }
        
        # Add Content-Type header
        headers["Content-Type"] = "application/json"
        
        # Make the API request
        url = f"{instance_url}/api/now/table/sys_update_set/{validated_params.changeset_id}"
        
        try:
            response = requests.patch(url, json=data, headers=headers)
            response.raise_for_status()
            
            result = response.json()
            
            return {
                "success": True,
                "message": "Changeset updated successfully",
                "changeset": result["result"],
            }
        except requests.exceptions.RequestException as e:
            logger.error(f"Error updating changeset: {e}")
            return {
                "success": False,
                "message": f"Error updating changeset: {str(e)}",
            }
  • Pydantic model defining the input parameters for the update_changeset tool, including required changeset_id and optional fields like name, description, state, developer.
    class UpdateChangesetParams(BaseModel):
        """Parameters for updating a changeset."""
    
        changeset_id: str = Field(..., description="Changeset ID or sys_id")
        name: Optional[str] = Field(None, description="Name of the changeset")
        description: Optional[str] = Field(None, description="Description of the changeset")
        state: Optional[str] = Field(None, description="State of the changeset")
        developer: Optional[str] = Field(None, description="Developer responsible for the changeset")
  • The tool registration entry in get_tool_definitions() dictionary, mapping 'update_changeset' to its handler (aliased as update_changeset_tool), schema (UpdateChangesetParams), description, and serialization settings.
    "update_changeset": (
        update_changeset_tool,
        UpdateChangesetParams,
        str,  # Expects JSON string
        "Update an existing changeset in ServiceNow",
        "json_dict",  # Tool returns Pydantic model
    ),
  • Import of the update_changeset function from changeset_tools.py in the tools package __init__.py, making it available for export.
    update_changeset,
  • Import alias of update_changeset as update_changeset_tool, used in the tool definitions.
    update_changeset as update_changeset_tool,
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but provides minimal information. It states this is an update operation (implying mutation) but doesn't mention required permissions, whether changes are reversible, what happens when only some fields are provided, or any rate limits. For a mutation tool with zero annotation coverage, this is inadequate.

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 gets straight to the point with zero wasted words. It's appropriately sized for a tool with a clear purpose and well-documented schema.

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?

For a mutation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what happens during the update, what the response contains, or any error conditions. Given the complexity of updating a changeset in ServiceNow and the lack of structured behavioral information, the description should provide more context about the operation.

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 schema description coverage is 100%, so the schema already fully documents all 5 parameters. The description adds no additional parameter information beyond what's in the schema. According to the scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.

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 action ('Update') and resource ('an existing changeset in ServiceNow'), making the purpose immediately understandable. However, it doesn't differentiate this tool from similar sibling tools like 'update_change_request' or 'update_article' beyond the resource type, which prevents 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 'create_changeset', 'get_changeset_details', 'list_changesets', 'commit_changeset', and 'publish_changeset' available, there's no indication of when this update operation is appropriate versus those other operations.

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

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