Skip to main content
Glama
vparlapalli490

ServiceNow MCP Server

create_knowledge_base

Create a new knowledge base in ServiceNow to organize and share information, specifying title, description, owner, 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

  • The main handler function implementing the create_knowledge_base tool. It constructs a POST request to the ServiceNow kb_knowledge_base table with the provided parameters and returns a KnowledgeBaseResponse.
    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 schema (parameters) for the create_knowledge_base tool, including title, description, owner, etc.
    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")
  • Registration of the 'create_knowledge_base' tool in the tool_definitions dictionary used by the MCP server, mapping the name to its handler, 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 statement exposing create_knowledge_base from knowledge_base.py in the tools package __init__, making it available for import.
    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 of the handler function aliased as create_knowledge_base_tool for use in tool registration.
        # 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 the tool creates something but doesn't mention whether this is a write operation requiring specific permissions, what happens on success/failure, or any side effects. For a creation tool with zero annotation coverage, this leaves critical behavioral traits undocumented.

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 function without unnecessary words. It's appropriately sized and front-loaded, with every word earning its place. No structural issues or verbosity detract from clarity.

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 insufficient. It doesn't explain what a knowledge base is in ServiceNow context, what happens after creation, or any behavioral expectations. The combination of mutation functionality and missing structured data requires more descriptive context than provided.

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%, with all parameters well-documented in the schema itself. The description adds no parameter information beyond what the schema provides, which is acceptable given the comprehensive schema documentation. The baseline score of 3 reflects adequate coverage through schema alone.

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 differentiate from siblings like 'create_article' or 'create_category', but the specificity of 'knowledge base' is sufficient 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 like 'create_article' or 'list_knowledge_bases', nor does it mention prerequisites such as required permissions or system context. It's a bare statement of function without usage context.

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