Skip to main content
Glama
javerthl

ServiceNow MCP Server

by javerthl

delete_story_dependency

Remove a story dependency in ServiceNow by providing the dependency sys_id to eliminate relationships between development tasks.

Instructions

Delete a story dependency in ServiceNow

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dependency_idYesSys_id of the dependency is required

Implementation Reference

  • The primary handler function that executes the delete_story_dependency tool. Validates input params, constructs the ServiceNow API DELETE endpoint for m2m_story_dependencies table using the dependency_id, and handles the HTTP request/response.
    def delete_story_dependency(
        auth_manager: AuthManager,
        server_config: ServerConfig,
        params: Dict[str, Any],
    ) -> Dict[str, Any]:
        """
        Delete a story dependency in ServiceNow.
    
        Args:
            auth_manager: The authentication manager.
            server_config: The server configuration.
            params: The parameters for deleting a story dependency.
    
        Returns:
            The deleted story dependency.
        """
        # Unwrap and validate parameters    
        result = _unwrap_and_validate_params(
            params, 
            DeleteStoryDependencyParams,
            required_fields=["dependency_id"]
        )
        
        if not result["success"]:
            return result
        
        validated_params = result["params"]
        
        # Get the instance URL
        instance_url = _get_instance_url(auth_manager, server_config)
        if not instance_url:
            return {
                "success": False,
                "message": "Cannot find instance_url in either server_config or auth_manager",
            }
        
        # Get the headers
        headers = _get_headers(auth_manager, server_config)
        if not headers:
            return {
                "success": False,   
                "message": "Cannot find get_headers method in either auth_manager or server_config",
            }
        
        # Make the API request
        url = f"{instance_url}/api/now/table/m2m_story_dependencies/{validated_params.dependency_id}"
        
        try:
            response = requests.delete(url, headers=headers)
            response.raise_for_status()
            
            return {
                "success": True,
                "message": "Story dependency deleted successfully",
            }
        except requests.exceptions.RequestException as e:
            logger.error(f"Error deleting story dependency: {e}")
            return {
                "success": False,
                "message": f"Error deleting story dependency: {str(e)}",
            }
  • Pydantic BaseModel schema defining the input parameters for the delete_story_dependency tool, specifically requiring the sys_id of the dependency to delete.
    class DeleteStoryDependencyParams(BaseModel):
        """Parameters for deleting a story dependency."""
    
        dependency_id: str = Field(..., description="Sys_id of the dependency is required")
  • Registration of the 'delete_story_dependency' tool in the central tool_definitions dictionary used by the MCP server. Maps the tool name to its handler function (aliased), params schema, return type, description, and serialization method.
    "delete_story_dependency": (
        delete_story_dependency_tool,
        DeleteStoryDependencyParams,
        str,
        "Delete a story dependency in ServiceNow",
        "str",
    ),
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool performs a deletion but doesn't mention critical aspects like whether this is reversible, what permissions are required, what happens to dependent data, or error conditions. This is inadequate for a destructive operation.

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 simple tool and front-loads the essential information immediately.

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 destructive tool with no annotations and no output schema, the description is insufficient. It doesn't explain what a 'story dependency' is, what deletion entails, what the response looks like, or potential side effects. Given the complexity and lack of structured data, more context is needed.

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 the single parameter 'dependency_id' as 'Sys_id of the dependency is required'. The description adds no additional parameter information beyond what the schema provides, meeting the baseline for high schema coverage.

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 ('Delete') and resource ('a story dependency in ServiceNow'), providing specific verb+resource information. However, it doesn't differentiate from sibling tools like 'delete_script_include' or 'delete_workflow_activity' 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. There are no mentions of prerequisites, conditions, or comparisons to sibling tools like 'list_story_dependencies' or 'create_story_dependency', leaving the agent without contextual usage information.

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