Skip to main content
Glama
JLKmach

ServiceNow MCP Server

by JLKmach

create_changeset

Create a new changeset in ServiceNow to manage and track application changes with specified name, application, description, and developer details.

Instructions

Create a new changeset in ServiceNow

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the changeset
descriptionNoDescription of the changeset
applicationYesApplication the changeset belongs to
developerNoDeveloper responsible for the changeset

Implementation Reference

  • Main handler function that executes the create_changeset tool: validates params, makes POST request to ServiceNow sys_update_set table, returns success or error.
    def create_changeset(
        auth_manager: AuthManager,
        server_config: ServerConfig,
        params: Union[Dict[str, Any], CreateChangesetParams],
    ) -> Dict[str, Any]:
        """
        Create a new changeset in ServiceNow.
    
        Args:
            auth_manager: The authentication manager.
            server_config: The server configuration.
            params: The parameters for creating a changeset. Can be a dictionary or a CreateChangesetParams object.
    
        Returns:
            The created changeset.
        """
        # Unwrap and validate parameters
        result = _unwrap_and_validate_params(
            params, 
            CreateChangesetParams, 
            required_fields=["name", "application"]
        )
        
        if not result["success"]:
            return result
        
        validated_params = result["params"]
        
        # Prepare the request data
        data = {
            "name": validated_params.name,
            "application": validated_params.application,
        }
        
        # Add optional fields if provided
        if validated_params.description:
            data["description"] = validated_params.description
        if validated_params.developer:
            data["developer"] = validated_params.developer
        
        # 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"
        
        try:
            response = requests.post(url, json=data, headers=headers)
            response.raise_for_status()
            
            result = response.json()
            
            return {
                "success": True,
                "message": "Changeset created successfully",
                "changeset": result["result"],
            }
        except requests.exceptions.RequestException as e:
            logger.error(f"Error creating changeset: {e}")
            return {
                "success": False,
                "message": f"Error creating changeset: {str(e)}",
            }
  • Pydantic model defining input parameters for create_changeset tool.
    class CreateChangesetParams(BaseModel):
        """Parameters for creating a changeset."""
    
        name: str = Field(..., description="Name of the changeset")
        description: Optional[str] = Field(None, description="Description of the changeset")
        application: str = Field(..., description="Application the changeset belongs to")
        developer: Optional[str] = Field(None, description="Developer responsible for the changeset")
  • MCP tool registration in get_tool_definitions(): maps 'create_changeset' to handler function alias, schema, description, etc.
    "create_changeset": (
        create_changeset_tool,
        CreateChangesetParams,
        str,  # Expects JSON string
        "Create a new changeset in ServiceNow",
        "json_dict",  # Tool returns Pydantic model
    ),
  • Import and alias of the create_changeset handler for use in MCP tool definitions.
    from servicenow_mcp.tools.changeset_tools import (
        create_changeset as create_changeset_tool,
    )
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. It states the action ('create') but doesn't describe what happens after creation (e.g., whether it's saved, pending, or requires approval), potential side effects, error conditions, or permission requirements. For a mutation tool with zero 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 with zero wasted words. It's front-loaded with the core action and resource, making it easy to parse. Every word earns its place, achieving optimal conciseness for such a simple statement.

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 (a mutation tool with no annotations and no output schema), the description is incomplete. It doesn't explain what a changeset is, what the creation entails (e.g., initial state, default values), or what the tool returns. For a tool that likely has significant behavioral implications in ServiceNow, this minimal description leaves critical gaps.

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 documents all four parameters (name, description, application, developer) with their types and requirements. The description adds no additional parameter semantics beyond what the schema provides, which aligns with the baseline score of 3 when the schema does the heavy lifting.

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 verb ('create') and resource ('changeset in ServiceNow'), making the purpose unambiguous. It distinguishes from siblings like 'update_changeset' or 'list_changesets' by specifying creation. However, it doesn't explicitly differentiate from other creation tools (e.g., 'create_change_request', 'create_incident'), 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. It doesn't mention prerequisites (e.g., needing specific permissions), when not to use it, or how it relates to sibling tools like 'commit_changeset' or 'publish_changeset'. This lack of context leaves the agent to infer usage from the tool name alone.

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