Skip to main content
Glama
JLKmach

ServiceNow MCP Server

by JLKmach

create_knowledge_base

Create a new knowledge base in ServiceNow to organize and share information, specifying title, description, owner, managers, and publication workflows.

Instructions

Create a new knowledge base in ServiceNow

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesTitle of the knowledge base
descriptionNoDescription of the knowledge base
ownerNoThe specified admin user or group
managersNoUsers who can manage this knowledge base
publish_workflowNoPublication workflowKnowledge - Instant Publish
retire_workflowNoRetirement workflowKnowledge - Instant Retire

Implementation Reference

  • Main handler function that executes the tool: builds data payload and POSTs to ServiceNow kb_knowledge_base table API endpoint.
    def create_knowledge_base(
        config: ServerConfig,
        auth_manager: AuthManager,
        params: CreateKnowledgeBaseParams,
    ) -> KnowledgeBaseResponse:
        """
        Create a new knowledge base in ServiceNow.
    
        Args:
            config: Server configuration.
            auth_manager: Authentication manager.
            params: Parameters for creating the knowledge base.
    
        Returns:
            Response with the created knowledge base details.
        """
        api_url = f"{config.api_url}/table/kb_knowledge_base"
    
        # Build request data
        data = {
            "title": params.title,
        }
    
        if params.description:
            data["description"] = params.description
        if params.owner:
            data["owner"] = params.owner
        if params.managers:
            data["kb_managers"] = params.managers
        if params.publish_workflow:
            data["workflow_publish"] = params.publish_workflow
        if params.retire_workflow:
            data["workflow_retire"] = params.retire_workflow
    
        # 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", {})
    
            return KnowledgeBaseResponse(
                success=True,
                message="Knowledge base created successfully",
                kb_id=result.get("sys_id"),
                kb_name=result.get("title"),
            )
    
        except requests.RequestException as e:
            logger.error(f"Failed to create knowledge base: {e}")
            return KnowledgeBaseResponse(
                success=False,
                message=f"Failed to create knowledge base: {str(e)}",
            )
  • Pydantic BaseModel defining input parameters with descriptions for MCP tool schema validation.
    class CreateKnowledgeBaseParams(BaseModel):
        """Parameters for creating a knowledge base."""
    
        title: str = Field(..., description="Title of the knowledge base")
        description: Optional[str] = Field(None, description="Description of the knowledge base")
        owner: Optional[str] = Field(None, description="The specified admin user or group")
        managers: Optional[str] = Field(None, description="Users who can manage this knowledge base")
        publish_workflow: Optional[str] = Field("Knowledge - Instant Publish", description="Publication workflow")
        retire_workflow: Optional[str] = Field("Knowledge - Instant Retire", description="Retirement workflow")
  • MCP tool registration in get_tool_definitions(): maps tool name to aliased handler function, input schema, description, and serialization method.
    "create_knowledge_base": (
        create_knowledge_base_tool,
        CreateKnowledgeBaseParams,
        str,  # Expects JSON string
        "Create a new knowledge base in ServiceNow",
        "json_dict",  # Tool returns Pydantic model
  • Import of create_knowledge_base handler from knowledge_base.py module for exposure via tools package.
    from servicenow_mcp.tools.knowledge_base import (
        create_article,
        create_category,
        create_knowledge_base,
        get_article,
        list_articles,
        list_knowledge_bases,
        publish_article,
        update_article,
        list_categories,
    )
  • Import aliasing the handler as create_knowledge_base_tool for use in tool definitions.
        # create_category aliased in function call
        create_knowledge_base as create_knowledge_base_tool,
    )
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 states this is a creation operation, implying it's a write/mutation tool, but provides no information about permissions required, whether the creation is immediate or requires approval, what happens on success/failure, or any side effects. This leaves significant gaps for an agent to understand the tool's behavior.

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 unnecessary words. It's appropriately sized for a creation tool and gets straight to the point with zero waste.

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 no annotations and no output schema, the description is insufficient. It doesn't explain what happens after creation (e.g., returns the new knowledge base ID), what permissions are needed, or how this integrates with the broader knowledge management system. The 100% schema coverage helps with parameters but doesn't compensate for the lack of behavioral context.

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 6 parameters. The description adds no parameter-specific information beyond what's in the schema, so it meets the baseline expectation but doesn't provide additional value like explaining relationships between parameters or usage patterns.

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 ('knowledge base in ServiceNow'), making the purpose immediately understandable. It doesn't specifically differentiate from sibling tools like 'create_article' or 'create_category', but the resource type is distinct enough for basic identification.

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. With sibling tools like 'list_knowledge_bases' and 'create_article' (which might be related to knowledge bases), there's no indication of prerequisites, appropriate contexts, or distinctions between creation tools.

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