Skip to main content
Glama
javerthl

ServiceNow MCP Server

by javerthl

create_knowledge_base

Create a new knowledge base in ServiceNow to organize and manage articles, documentation, and support resources for internal or external users.

Instructions

Create a new knowledge base in ServiceNow

Input Schema

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

Implementation Reference

  • The core handler function that implements the logic to create a knowledge base by making 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 model 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")
  • Registration of the 'create_knowledge_base' tool in the central tool definitions dictionary used by the MCP server, specifying the handler function, input schema, return type, 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 and exposure of the create_knowledge_base function in the tools package __init__.py for easy access.
    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 the full burden of behavioral disclosure. It states this is a creation operation but doesn't mention required permissions, whether this is a write operation (implied but not explicit), what happens on success/failure, or any side effects. 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 with zero wasted words. It's appropriately sized for a tool with good schema documentation and gets straight to the point without unnecessary elaboration.

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' represents in ServiceNow context, what happens after creation, or provide any behavioral context. The schema handles parameter documentation, but the description fails to add meaningful value beyond the tool name.

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 all parameters are documented in the schema. The description adds no additional parameter information beyond what's already in the structured data. This meets the baseline expectation when the schema does the heavy lifting.

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 from sibling tools like 'create_article' or 'create_category' that also create ServiceNow resources, so it doesn't reach the highest 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 'list_knowledge_bases' for viewing existing ones or 'create_article' for adding content. There's no mention of prerequisites, dependencies, or typical use cases.

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/javerthl/servicenow-mcp'

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