Skip to main content
Glama
JLKmach

ServiceNow MCP Server

by JLKmach

create_project

Create new projects in ServiceNow by specifying name, status, manager, dates, and completion details for project management.

Instructions

Create a new project in ServiceNow

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
short_descriptionYesProject name of the project
descriptionNoDetailed description of the project
statusNoStatus of the project (green, yellow, red)
stateNoState of project (-5 is Pending,1 is Open, 2 is Work in progress, 3 is Closed Complete, 4 is Closed Incomplete, 5 is Closed Skipped)
project_managerNoProject manager for the project
percentage_completeNoPercentage complete for the project
assignment_groupNoGroup assigned to the project
assigned_toNoUser assigned to the project
start_dateNoStart date for the project
end_dateNoEnd date for the project

Implementation Reference

  • Core implementation of the create_project tool handler. Validates input using CreateProjectParams, constructs payload, and performs POST to ServiceNow's pm_project table.
    def create_project(
        config: ServerConfig,  # Changed from auth_manager
        auth_manager: AuthManager,  # Changed from server_config
        params: Dict[str, Any],
    ) -> Dict[str, Any]:
        """
        Create a new project in ServiceNow.
    
        Args:
            config: The server configuration.
            auth_manager: The authentication manager.
            params: The parameters for creating the project.
    
        Returns:
            The created project.
        """
    
        # Unwrap and validate parameters
        result = _unwrap_and_validate_params(
            params, 
            CreateProjectParams, 
            required_fields=["short_description"]
        )
        
        if not result["success"]:
            return result
        
        validated_params = result["params"]
        
        # Prepare the request data
        data = {
            "short_description": validated_params.short_description,
        }
    
        # Add optional fields if provided
        if validated_params.description:
            data["description"] = validated_params.description
        if validated_params.status:
            data["status"] = validated_params.status
        if validated_params.state:
            data["state"] = validated_params.state
        if validated_params.assignment_group:
            data["assignment_group"] = validated_params.assignment_group
        if validated_params.percentage_complete:
            data["percentage_complete"] = validated_params.percentage_complete
        if validated_params.assigned_to:
            data["assigned_to"] = validated_params.assigned_to
        if validated_params.project_manager:
            data["project_manager"] = validated_params.project_manager
        if validated_params.start_date:
            data["start_date"] = validated_params.start_date
        if validated_params.end_date:
            data["end_date"] = validated_params.end_date
        
        # Get the instance URL
        instance_url = _get_instance_url(auth_manager, 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, 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/pm_project"
        
        try:
            response = requests.post(url, json=data, headers=headers)
            response.raise_for_status()
            
            result = response.json()
            
            return {
                "success": True,
                "message": "Project created successfully",
                "project": result["result"],
            }
        except requests.exceptions.RequestException as e:
            logger.error(f"Error creating project: {e}")
            return {
                "success": False,
                "message": f"Error creating project: {str(e)}",
            }
  • Pydantic model defining the input schema/parameters for the create_project tool.
    class CreateProjectParams(BaseModel):
        """Parameters for creating a project."""
    
        short_description: str = Field(..., description="Project name of the project")
        description: Optional[str] = Field(None, description="Detailed description of the project")
        status: Optional[str] = Field(None, description="Status of the project (green, yellow, red)")
        state: Optional[str] = Field(None, description="State of project (-5 is Pending,1 is Open, 2 is Work in progress, 3 is Closed Complete, 4 is Closed Incomplete, 5 is Closed Skipped)")
        project_manager: Optional[str] = Field(None, description="Project manager for the project")
        percentage_complete: Optional[int] = Field(None, description="Percentage complete for the project")
        assignment_group: Optional[str] = Field(None, description="Group assigned to the project")
        assigned_to: Optional[str] = Field(None, description="User assigned to the project")
        start_date: Optional[str] = Field(None, description="Start date for the project")
        end_date: Optional[str] = Field(None, description="End date for the project")
  • Registration of the 'create_project' tool in the central tool_definitions dictionary, linking the handler, schema, description, etc. for MCP server.
    "create_project": (
        create_project_tool,
        CreateProjectParams,
        str,
        "Create a new project in ServiceNow",
        "str",
    ),
  • Import of create_project handler and CreateProjectParams schema into tool_utils for registration.
    from servicenow_mcp.tools.project_tools import (
        CreateProjectParams,
        UpdateProjectParams,
        ListProjectsParams,
    )
    from servicenow_mcp.tools.project_tools import (
        create_project as create_project_tool,
        update_project as update_project_tool,
        list_projects as list_projects_tool,
    )
  • Re-export of create_project from project_tools.py in tools __init__ for easy access.
    from servicenow_mcp.tools.project_tools import (
        create_project,
        update_project,
        list_projects,
    )
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. While 'Create' implies a write operation, the description doesn't mention permission requirements, whether the creation is reversible, what happens on success/failure, or any 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, efficient sentence that states the core purpose without any wasted words. It's appropriately sized and front-loaded with the essential information.

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 creation tool with 10 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what happens after creation, what the tool returns, or provide any behavioral context beyond the basic action. The schema handles parameters well, but the description fails to address other critical aspects.

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 10 parameters thoroughly with descriptions, types, and defaults. The description adds no parameter information beyond what's in the schema, meeting the baseline expectation but not providing additional value.

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 project in ServiceNow'), making the purpose immediately understandable. However, it doesn't differentiate this tool from other creation tools in the sibling list (like create_article, create_change_request, etc.), 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. There's no mention of prerequisites, when not to use it, or how it relates to other project-related tools like 'list_projects' or 'update_project' in the sibling list.

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