Skip to main content
Glama
vparlapalli490

ServiceNow MCP Server

create_group

Create a new group in ServiceNow by specifying name, description, manager, parent group, type, email, members, and active status.

Instructions

Create a new group in ServiceNow

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the group
descriptionNoDescription of the group
managerNoManager of the group (sys_id or username)
parentNoParent group (sys_id or name)
typeNoType of the group
emailNoEmail address for the group
membersNoList of user sys_ids or usernames to add as members
activeNoWhether the group is active

Implementation Reference

  • The handler function that implements the create_group tool. It constructs a POST request to the ServiceNow sys_user_group table API to create a new group, handles optional fields, adds members if specified, and returns a GroupResponse.
    def create_group(
        config: ServerConfig,
        auth_manager: AuthManager,
        params: CreateGroupParams,
    ) -> GroupResponse:
        """
        Create a new group in ServiceNow.
    
        Args:
            config: Server configuration.
            auth_manager: Authentication manager.
            params: Parameters for creating the group.
    
        Returns:
            Response with the created group details.
        """
        api_url = f"{config.api_url}/table/sys_user_group"
    
        # Build request data
        data = {
            "name": params.name,
            "active": str(params.active).lower(),
        }
    
        if params.description:
            data["description"] = params.description
        if params.manager:
            data["manager"] = params.manager
        if params.parent:
            data["parent"] = params.parent
        if params.type:
            data["type"] = params.type
        if params.email:
            data["email"] = params.email
    
        # Make request
        try:
            response = requests.post(
                api_url,
                json=data,
                headers=auth_manager.get_headers(),
                timeout=config.timeout,
            )
            response.raise_for_status()
    
            result = response.json().get("result", {})
            group_id = result.get("sys_id")
    
            # Add members if provided
            if params.members and group_id:
                add_group_members(
                    config,
                    auth_manager,
                    AddGroupMembersParams(group_id=group_id, members=params.members),
                )
    
            return GroupResponse(
                success=True,
                message="Group created successfully",
                group_id=group_id,
                group_name=result.get("name"),
            )
    
        except requests.RequestException as e:
            logger.error(f"Failed to create group: {e}")
            return GroupResponse(
                success=False,
                message=f"Failed to create group: {str(e)}",
            )
  • Pydantic BaseModel defining the input parameters and validation for the create_group tool, including required name and optional fields like description, manager, members, etc.
    class CreateGroupParams(BaseModel):
        """Parameters for creating a group."""
    
        name: str = Field(..., description="Name of the group")
        description: Optional[str] = Field(None, description="Description of the group")
        manager: Optional[str] = Field(None, description="Manager of the group (sys_id or username)")
        parent: Optional[str] = Field(None, description="Parent group (sys_id or name)")
        type: Optional[str] = Field(None, description="Type of the group")
        email: Optional[str] = Field(None, description="Email address for the group")
        members: Optional[List[str]] = Field(
            None, description="List of user sys_ids or usernames to add as members"
        )
        active: Optional[bool] = Field(True, description="Whether the group is active")
  • Tool registration entry in get_tool_definitions() dictionary that maps 'create_group' to its handler function (create_group_tool), input schema (CreateGroupParams), return type, description, and serialization method.
    "create_group": (
        create_group_tool,
        CreateGroupParams,
        Dict[str, Any],  # Expects dict
        "Create a new group in ServiceNow",
        "raw_dict",
    ),
  • Import statement in tools/__init__.py that exposes create_group function for use across the tools module.
    from servicenow_mcp.tools.user_tools import (
        create_user,
        update_user,
        get_user,
        list_users,
        create_group,
        update_group,
        add_group_members,
        remove_group_members,
        list_groups,
    )
  • Pydantic BaseModel defining the output response structure for group operations including create_group.
    class GroupResponse(BaseModel):
        """Response from group operations."""
    
        success: bool = Field(..., description="Whether the operation was successful")
        message: str = Field(..., description="Message describing the result")
        group_id: Optional[str] = Field(None, description="ID of the affected group")
        group_name: Optional[str] = Field(None, description="Name of the affected group")
Behavior2/5

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

With no annotations provided, the description carries full responsibility for behavioral disclosure. It states 'Create' which implies a write operation, but fails to mention important aspects like required permissions, whether creation is irreversible, potential side effects, or what the response contains. 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, efficient sentence that communicates the core purpose without unnecessary words. It's appropriately sized for a straightforward creation tool and gets directly to the point.

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 8 parameters, no annotations, and no output schema, the description is insufficient. It doesn't address behavioral aspects like permissions, side effects, or response format, leaving significant gaps in understanding how to properly use this tool.

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, providing clear documentation for all 8 parameters. The description adds no additional parameter information beyond what's already in the schema, so it meets the baseline expectation but doesn't enhance parameter understanding.

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 ('a new group in ServiceNow'), making the purpose immediately understandable. However, it doesn't differentiate this tool from sibling tools like 'create_user' or 'create_incident' 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 like 'update_group' or 'list_groups', nor does it mention prerequisites such as required permissions or system context. This leaves the agent without contextual usage information.

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/vparlapalli490/MCP'

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