Skip to main content
Glama
echelon-ai-labs

ServiceNow MCP Server

update_catalog_category

Update an existing service catalog category in ServiceNow, modifying attributes like title, description, icon, order, parent category, and active status using the Category ID or sys_id.

Instructions

Update an existing service catalog category.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Implementation Reference

  • Main handler function that performs the PATCH request to update a ServiceNow service catalog category.
    def update_catalog_category(
        config: ServerConfig,
        auth_manager: AuthManager,
        params: UpdateCatalogCategoryParams,
    ) -> CatalogResponse:
        """
        Update an existing service catalog category in ServiceNow.
    
        Args:
            config: Server configuration
            auth_manager: Authentication manager
            params: Parameters for updating a catalog category
    
        Returns:
            Response containing the result of the operation
        """
        logger.info(f"Updating service catalog category: {params.category_id}")
        
        # Build the API URL
        url = f"{config.instance_url}/api/now/table/sc_category/{params.category_id}"
        
        # Prepare request body with only the provided parameters
        body = {}
        if params.title is not None:
            body["title"] = params.title
        if params.description is not None:
            body["description"] = params.description
        if params.parent is not None:
            body["parent"] = params.parent
        if params.icon is not None:
            body["icon"] = params.icon
        if params.active is not None:
            body["active"] = str(params.active).lower()
        if params.order is not None:
            body["order"] = str(params.order)
        
        # Make the API request
        headers = auth_manager.get_headers()
        headers["Accept"] = "application/json"
        headers["Content-Type"] = "application/json"
        
        try:
            response = requests.patch(url, headers=headers, json=body)
            response.raise_for_status()
            
            # Process the response
            result = response.json()
            category = result.get("result", {})
            
            # Format the response
            formatted_category = {
                "sys_id": category.get("sys_id", ""),
                "title": category.get("title", ""),
                "description": category.get("description", ""),
                "parent": category.get("parent", ""),
                "icon": category.get("icon", ""),
                "active": category.get("active", ""),
                "order": category.get("order", ""),
            }
            
            return CatalogResponse(
                success=True,
                message=f"Updated catalog category: {params.category_id}",
                data=formatted_category,
            )
        
        except requests.exceptions.RequestException as e:
            logger.error(f"Error updating catalog category: {str(e)}")
            return CatalogResponse(
                success=False,
                message=f"Error updating catalog category: {str(e)}",
                data=None,
            )
  • Pydantic model defining the input parameters for the update_catalog_category tool.
    class UpdateCatalogCategoryParams(BaseModel):
        """Parameters for updating a service catalog category."""
        
        category_id: str = Field(..., description="Category ID or sys_id")
        title: Optional[str] = Field(None, description="Title of the category")
        description: Optional[str] = Field(None, description="Description of the category")
        parent: Optional[str] = Field(None, description="Parent category sys_id")
        icon: Optional[str] = Field(None, description="Icon for the category")
        active: Optional[bool] = Field(None, description="Whether the category is active")
        order: Optional[int] = Field(None, description="Order of the category")
  • Registration of the tool in the central tool definitions dictionary used by the MCP server.
    "update_catalog_category": (
        update_catalog_category_tool,
        UpdateCatalogCategoryParams,
        str,  # Expects JSON string
        "Update an existing service catalog category.",
        "json_dict",  # Tool returns Pydantic model
    ),
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions 'update' which implies mutation, but doesn't specify permissions required, whether changes are reversible, error handling, or rate limits. This is inadequate for a mutation tool with zero annotation coverage.

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, clear sentence with no wasted words. It's appropriately sized for a basic tool definition and front-loads the essential action, though this conciseness comes at the cost of completeness.

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, no output schema, and 7 parameters (through 'params'), the description is insufficient. It doesn't explain what 'update' entails, what fields can be modified, or what the response contains, making it inadequate for safe and effective tool invocation.

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

Parameters1/5

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

The description provides no information about parameters beyond the generic 'update' action. With 0% schema description coverage and 7 parameters (through the 'params' object), the description fails to compensate for the lack of schema documentation, leaving all parameters semantically undefined.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the verb ('Update') and resource ('an existing service catalog category'), which provides a basic understanding of purpose. However, it doesn't differentiate from sibling tools like 'update_catalog_item' or 'update_category', nor does it specify what aspects can be updated beyond the generic term 'update'.

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?

No guidance is provided on when to use this tool versus alternatives like 'create_catalog_category' or 'list_catalog_categories'. The description lacks context about prerequisites (e.g., needing an existing category ID) or exclusions, leaving 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

Related 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/echelon-ai-labs/servicenow-mcp'

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