Skip to main content
Glama
JLKmach

ServiceNow MCP Server

by JLKmach

get_workflow_details

Retrieve comprehensive details about a specific ServiceNow workflow, including its configuration and optional version history, to analyze and manage automation processes.

Instructions

Get detailed information about a specific workflow

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workflow_idYesWorkflow ID or sys_id
include_versionsNoInclude workflow versions

Implementation Reference

  • The handler function that executes the get_workflow_details tool logic, making an API call to retrieve workflow details from ServiceNow.
    def get_workflow_details(
        auth_manager: AuthManager,
        server_config: ServerConfig,
        params: Dict[str, Any],
    ) -> Dict[str, Any]:
        """
        Get detailed information about a specific workflow.
        
        Args:
            auth_manager: Authentication manager
            server_config: Server configuration
            params: Parameters for getting workflow details
            
        Returns:
            Dictionary containing the workflow details
        """
        params = _unwrap_params(params, GetWorkflowDetailsParams)
        
        # Get the correct auth_manager and server_config
        try:
            auth_manager, server_config = _get_auth_and_config(auth_manager, server_config)
        except ValueError as e:
            logger.error(f"Error getting auth and config: {e}")
            return {"error": str(e)}
        
        workflow_id = params.get("workflow_id")
        if not workflow_id:
            return {"error": "Workflow ID is required"}
        
        # Make the API request
        try:
            headers = auth_manager.get_headers()
            url = f"{server_config.instance_url}/api/now/table/wf_workflow/{workflow_id}"
            
            response = requests.get(url, headers=headers)
            response.raise_for_status()
            
            result = response.json()
            return {
                "workflow": result.get("result", {}),
            }
        except requests.RequestException as e:
            logger.error(f"Error getting workflow details: {e}")
            return {"error": str(e)}
        except Exception as e:
            logger.error(f"Unexpected error getting workflow details: {e}")
            return {"error": str(e)}
  • Pydantic model defining the input schema for the get_workflow_details tool, including required workflow_id and optional include_versions.
    class GetWorkflowDetailsParams(BaseModel):
        """Parameters for getting workflow details."""
        
        workflow_id: str = Field(..., description="Workflow ID or sys_id")
        include_versions: Optional[bool] = Field(False, description="Include workflow versions")
  • Registers the 'get_workflow_details' tool in the MCP server's tool_definitions dictionary, linking the handler function, input schema, description, and output serialization method.
    "get_workflow_details": (
        get_workflow_details_tool,
        GetWorkflowDetailsParams,
        str,  # Expects JSON string
        "Get detailed information about a specific workflow",
        "json",  # Tool returns list/dict
    ),
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. While 'Get' implies a read operation, it doesn't specify whether this requires authentication, what format the detailed information returns, whether there are rate limits, or if there are any side effects. The description is minimal and lacks important behavioral context.

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 gets straight to the point with zero wasted words. It's appropriately sized for a simple retrieval tool and is perfectly front-loaded with the essential information.

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

Completeness3/5

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

For a read operation with 2 parameters and 100% schema coverage, the description is adequate but minimal. However, with no output schema and no annotations, the description doesn't provide enough context about what 'detailed information' includes or the behavioral characteristics. It meets minimum requirements but leaves significant gaps.

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%, so the schema already documents both parameters thoroughly. The description adds no additional parameter information beyond what's in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in 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 clearly states the verb ('Get') and resource ('detailed information about a specific workflow'), making the purpose unambiguous. However, it doesn't distinguish this tool from potential siblings like 'list_workflows' or 'get_workflow_activities' beyond specifying 'detailed information' versus listing multiple workflows.

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. With many sibling tools available (including 'list_workflows' and 'get_workflow_activities'), there's no indication of when detailed information about a single workflow is needed versus listing workflows or getting workflow activities.

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