Skip to main content
Glama
echelon-ai-labs

ServiceNow MCP Server

create_knowledge_base

Create a knowledge base in ServiceNow with customizable workflows, managers, and ownership. Define titles, descriptions, and publication or retirement processes for efficient knowledge management.

Instructions

Create a new knowledge base in ServiceNow

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Implementation Reference

  • Implements the core logic for creating a knowledge base by sending a POST request to the ServiceNow kb_knowledge_base table API.
    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 the input parameters and validation for the create_knowledge_base tool.
    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")
  • Registers the create_knowledge_base tool in the central tool definitions dictionary, linking the 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
    ),
  • Imports the create_knowledge_base handler function with alias for use in tool registration.
        # create_category aliased in function call
        create_knowledge_base as create_knowledge_base_tool,
    )
  • Re-exports create_knowledge_base from knowledge_base.py module for convenient access.
    from servicenow_mcp.tools.knowledge_base import (
        create_article,
        create_category,
        create_knowledge_base,
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. While 'Create' implies a write operation, it doesn't specify required permissions, whether creation is immediate or requires approval, what happens on failure, or any rate limits. For a mutation tool with zero annotation coverage, this leaves significant behavioral questions unanswered.

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 gets straight to the point with zero wasted words. It's appropriately sized for a basic tool description and front-loads 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 6 parameters, no annotations, and no output schema, the description is severely incomplete. It doesn't explain what a knowledge base is, what parameters are required, what the tool returns, or any behavioral aspects. The agent would struggle to use this tool effectively without additional context.

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 mentions no parameters at all, while the input schema shows 6 parameters (title, description, managers, owner, publish_workflow, retire_workflow) with 0% schema description coverage. The description fails to compensate for this complete lack of parameter documentation, leaving the agent with no guidance on what information is needed to create a knowledge base.

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. However, it doesn't differentiate this from other creation tools like create_article, create_category, or create_change_request, which would require specifying what distinguishes a knowledge base from these other entities.

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, appropriate contexts, or how this differs from similar creation tools like create_article or create_category. The agent must 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