Skip to main content
Glama
JLKmach

ServiceNow MCP Server

by JLKmach

create_article

Create knowledge articles in ServiceNow with title, content, categories, and metadata to document solutions and share information across teams.

Instructions

Create a new knowledge article

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesTitle of the article
textYesThe main body text for the article. Field supports html formatting and wiki markup based on the article_type. HTML is the default.
short_descriptionYesShort description of the article
knowledge_baseYesThe knowledge base to create the article in
categoryYesCategory for the article
keywordsNoKeywords for search
article_typeNoThe type of article. Options are 'text' or 'wiki'. text lets the text field support html formatting. wiki lets the text field support wiki markup.html

Implementation Reference

  • The core handler function that implements the logic for creating a new knowledge article in ServiceNow by posting data to the kb_knowledge table.
    def create_article(
        config: ServerConfig,
        auth_manager: AuthManager,
        params: CreateArticleParams,
    ) -> ArticleResponse:
        """
        Create a new knowledge article.
    
        Args:
            config: Server configuration.
            auth_manager: Authentication manager.
            params: Parameters for creating the article.
    
        Returns:
            Response with the created article details.
        """
        api_url = f"{config.api_url}/table/kb_knowledge"
    
        # Build request data
        data = {
            "short_description": params.short_description,
            "text": params.text,
            "kb_knowledge_base": params.knowledge_base,
            "kb_category": params.category,
            "article_type": params.article_type,
        }
    
        if params.title:
            data["short_description"] = params.title
        if params.keywords:
            data["keywords"] = params.keywords
    
        # 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 ArticleResponse(
                success=True,
                message="Article created successfully",
                article_id=result.get("sys_id"),
                article_title=result.get("short_description"),
                workflow_state=result.get("workflow_state"),
            )
    
        except requests.RequestException as e:
            logger.error(f"Failed to create article: {e}")
            return ArticleResponse(
                success=False,
                message=f"Failed to create article: {str(e)}",
            )
  • Pydantic model defining the input schema/validation for the create_article tool parameters.
    class CreateArticleParams(BaseModel):
        """Parameters for creating a knowledge article."""
    
        title: str = Field(..., description="Title of the article")
        text: str = Field(..., description="The main body text for the article. Field supports html formatting and wiki markup based on the article_type. HTML is the default.")
        short_description: str = Field(..., description="Short description of the article")
        knowledge_base: str = Field(..., description="The knowledge base to create the article in")
        category: str = Field(..., description="Category for the article")
        keywords: Optional[str] = Field(None, description="Keywords for search")
        article_type: Optional[str] = Field("html", description="The type of article. Options are 'text' or 'wiki'. text lets the text field support html formatting. wiki lets the text field support wiki markup.")
  • Registration of the create_article tool in the central tool definitions dictionary used by the MCP server, specifying the handler, input schema, return type hint, description, and serialization method.
    "create_article": (
        create_article_tool,
        CreateArticleParams,
        str,  # Expects JSON string
        "Create a new knowledge article",
        "json_dict",  # Tool returns Pydantic model
    ),
  • Import of the create_article function into the tools package namespace, exposing it for use.
    from servicenow_mcp.tools.knowledge_base import (
        create_article,
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 'Create a new knowledge article' which implies a write operation, but doesn't mention permissions required, whether the article is draft or published by default, error conditions, or what the response contains. This leaves significant gaps for a mutation tool.

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 for a tool with a clear name and comprehensive schema documentation.

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 mutation tool with 7 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what happens after creation (e.g., article state, return values), permissions needed, or how it relates to sibling tools like 'publish_article'. The agent lacks crucial context for proper tool selection and invocation.

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 additional parameter information beyond what's in the schema, so it meets the baseline of 3 where the schema does the heavy lifting without compensating with extra context.

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 'Create a new knowledge article' clearly states the verb (create) and resource (knowledge article), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'create_category' or 'create_knowledge_base' beyond the resource type, 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 like 'update_article' or 'publish_article', nor does it mention prerequisites such as needing an existing knowledge base. Without any context about usage scenarios or exclusions, the agent must infer this 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

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