Skip to main content
Glama
JLKmach

ServiceNow MCP Server

by JLKmach

publish_article

Publish knowledge articles in ServiceNow to make them available to users. Set workflow states and versions to control article visibility and lifecycle.

Instructions

Publish a knowledge article

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
article_idYesID of the article to publish
workflow_stateNoThe workflow state to setpublished
workflow_versionNoThe workflow version to use

Implementation Reference

  • The handler function that executes the publish_article tool logic by PATCHing the workflow_state of the specified knowledge article.
    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 tool definitions dictionary, associating the handler function, input schema, return type hint, description, and serialization method.
    "publish_article": (
        publish_article_tool,
        PublishArticleParams,
        str,  # Expects JSON string
        "Publish a knowledge article",
        "json_dict",  # Tool returns Pydantic model
    ),
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Publish a knowledge article' implies a mutation operation that likely changes an article's state, but it doesn't specify critical details: whether publishing is reversible, what permissions are required, if it triggers notifications or workflows, or what the expected outcome is. For a mutation tool with zero annotation coverage, this lack of behavioral context is a significant gap.

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 waste: 'Publish a knowledge article'. It is front-loaded with the core action and resource, making it immediately clear. Every word earns its place, and there is no redundant or verbose language, achieving optimal conciseness for such a straightforward tool.

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?

Given the complexity of a mutation tool (publishing an article) with no annotations and no output schema, the description is incomplete. It doesn't explain the behavioral implications, success conditions, or error cases. While the schema covers parameters well, the overall context for safe and effective use is lacking, especially compared to siblings that might handle related operations like 'update_article' or 'publish_changeset'.

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?

Schema description coverage is 100%, with clear descriptions for all three parameters (article_id, workflow_state, workflow_version). The description adds no additional parameter semantics beyond what the schema provides, such as explaining default behaviors or valid values. Given the high schema coverage, a baseline score of 3 is appropriate, as the schema adequately documents parameters without extra help from the description.

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 'Publish a knowledge article' clearly states the verb ('publish') and resource ('knowledge article'), making the purpose immediately understandable. It distinguishes from siblings like 'create_article' (creation) and 'update_article' (modification), though it doesn't explicitly mention these distinctions. The description is specific but could be more precise about what 'publish' entails operationally.

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 (e.g., an article must exist via 'create_article' or 'update_article'), conditions for publishing, or differences from similar tools like 'publish_changeset'. Without such context, an agent must infer usage from the tool name alone, which is insufficient for optimal 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

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