Skip to main content
Glama
echelon-ai-labs

ServiceNow MCP Server

publish_article

Submit and set the workflow state of a knowledge article to publish it on ServiceNow using the specified article ID and version.

Instructions

Publish a knowledge article

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Implementation Reference

  • Implements the core logic for publishing a knowledge article by PATCHing the workflow_state on the kb_knowledge table.
    def publish_article(
        config: ServerConfig,
        auth_manager: AuthManager,
        params: PublishArticleParams,
    ) -> ArticleResponse:
        """
        Publish a knowledge article.
    
        Args:
            config: Server configuration.
            auth_manager: Authentication manager.
            params: Parameters for publishing the article.
    
        Returns:
            Response with the published article details.
        """
        api_url = f"{config.api_url}/table/kb_knowledge/{params.article_id}"
    
        # Build request data
        data = {
            "workflow_state": params.workflow_state,
        }
    
        if params.workflow_version:
            data["workflow_version"] = params.workflow_version
    
        # Make request
        try:
            response = requests.patch(
                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 published successfully",
                article_id=params.article_id,
                article_title=result.get("short_description"),
                workflow_state=result.get("workflow_state"),
            )
    
        except requests.RequestException as e:
            logger.error(f"Failed to publish article: {e}")
            return ArticleResponse(
                success=False,
                message=f"Failed to publish article: {str(e)}",
            )
  • Pydantic model defining the input parameters for the publish_article tool.
    class PublishArticleParams(BaseModel):
        """Parameters for publishing a knowledge article."""
    
        article_id: str = Field(..., description="ID of the article to publish")
        workflow_state: Optional[str] = Field("published", description="The workflow state to set")
        workflow_version: Optional[str] = Field(None, description="The workflow version to use")
  • Registers the publish_article tool in the central tool definitions dictionary used by the MCP server, including function, params schema, description, and serialization details.
    "publish_article": (
        publish_article_tool,
        PublishArticleParams,
        str,  # Expects JSON string
        "Publish a knowledge article",
        "json_dict",  # Tool returns Pydantic model
    ),
  • Imports the publish_article function into the tools package namespace for exposure.
    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,
    )
  • Includes publish_article in the __all__ list for proper package export.
    # Knowledge Base tools
    "create_knowledge_base",
    "list_knowledge_bases",
    "create_category",
    "list_categories",
    "create_article",
    "update_article",
    "publish_article",
    "list_articles",
    "get_article",
Behavior1/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 but fails to do so. It doesn't indicate whether this is a read-only or destructive operation, what permissions are required, potential side effects (e.g., making content publicly visible), or error conditions. The description is too vague to inform the agent about the tool's behavior beyond the basic action implied by the name.

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 extremely concise with a single sentence, 'Publish a knowledge article', which is front-loaded and wastes no words. While this brevity contributes to clarity in structure, it results in significant informational gaps as noted in other dimensions.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a publishing operation (likely a mutation with side effects), no annotations, no output schema, and 0% schema description coverage, the description is severely incomplete. It fails to address critical aspects like what publishing entails, expected outcomes, error handling, or how it differs from related tools, making it inadequate for safe and effective use by an AI agent.

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 schema description coverage is 0%, meaning parameter descriptions in the schema are minimal or generic. The tool description adds no information about parameters beyond what's implied by the tool name. It doesn't explain the 'article_id' requirement, the purpose of 'workflow_state' or 'workflow_version', or how these parameters affect the publishing process. This leaves all parameter semantics undocumented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Publish a knowledge article' is a tautology that essentially restates the tool name 'publish_article' with minimal elaboration. While it identifies the verb ('publish') and resource ('knowledge article'), it lacks specificity about what publishing entails (e.g., making it live, changing workflow states) and doesn't distinguish it from potential siblings like 'update_article' or 'create_article'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/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 (e.g., needing an existing article), exclusions, or relationships with sibling tools like 'create_article' (for creation) or 'update_article' (for modifications before publishing). This leaves the agent with no contextual cues for appropriate tool selection.

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