Skip to main content
Glama
echelon-ai-labs

ServiceNow MCP Server

create_catalog_category

Define and organize service catalog categories in ServiceNow by setting titles, descriptions, icons, order, and parent relationships for improved service management.

Instructions

Create a new service catalog category.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Implementation Reference

  • The handler function implementing the create_catalog_category tool. It constructs a POST request to the ServiceNow sc_category table API with the provided parameters and returns a formatted CatalogResponse.
    def create_catalog_category(
        config: ServerConfig,
        auth_manager: AuthManager,
        params: CreateCatalogCategoryParams,
    ) -> CatalogResponse:
        """
        Create a new service catalog category in ServiceNow.
    
        Args:
            config: Server configuration
            auth_manager: Authentication manager
            params: Parameters for creating a catalog category
    
        Returns:
            Response containing the result of the operation
        """
        logger.info("Creating new service catalog category")
        
        # Build the API URL
        url = f"{config.instance_url}/api/now/table/sc_category"
        
        # Prepare request body
        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.post(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"Created catalog category: {params.title}",
                data=formatted_category,
            )
        
        except requests.exceptions.RequestException as e:
            logger.error(f"Error creating catalog category: {str(e)}")
            return CatalogResponse(
                success=False,
                message=f"Error creating catalog category: {str(e)}",
                data=None,
            )
  • Pydantic BaseModel defining the input schema for the create_catalog_category tool, including fields for title, description, parent, icon, active status, and order.
    class CreateCatalogCategoryParams(BaseModel):
        """Parameters for creating a new service catalog category."""
        
        title: str = Field(..., 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: bool = Field(True, description="Whether the category is active")
        order: Optional[int] = Field(None, description="Order of the category")
  • The registration entry in the tool_definitions dictionary within get_tool_definitions function. Maps the tool name to its implementation function (aliased), params model, return type hint, description, and serialization method.
    "create_catalog_category": (
        create_catalog_category_tool,
        CreateCatalogCategoryParams,
        str,  # Expects JSON string
        "Create a new service catalog category.",
        "json_dict",  # Tool returns Pydantic model
    ),
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. 'Create' implies a write/mutation operation, but the description doesn't state whether this requires specific permissions, what happens on success/failure, if there are rate limits, or if the creation is irreversible. For a mutation tool with zero annotation coverage, this leaves significant behavioral gaps.

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 zero wasted words. It's front-loaded with the core action and resource, making it immediately scannable. Every word earns its place by conveying essential purpose without redundancy.

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 6 parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what parameters are needed, what the tool returns, or any behavioral constraints. While concise, it fails to provide the contextual information necessary for safe and effective use by an AI agent.

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 schema description coverage is 0%, meaning none of the parameters are documented in the schema. The description provides no information about parameters beyond what's implied by 'category' (e.g., it doesn't mention required fields like 'title' or optional ones like 'description', 'icon', etc.). With 6 parameters (nested under 'params') completely undocumented, the description fails to compensate for the schema's lack of documentation.

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 ('Create') and resource ('new service catalog category'), making the purpose immediately understandable. It distinguishes from siblings like 'update_catalog_category' and 'list_catalog_categories' by specifying creation rather than modification or listing. However, it doesn't explicitly mention what distinguishes it from 'create_category' (a sibling tool), 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 admin rights), when to choose this over 'update_catalog_category' for modifications, or how it relates to 'create_category' (another sibling). Without any usage context, the agent must infer when this tool is appropriate.

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