Skip to main content
Glama
JLKmach

ServiceNow MCP Server

by JLKmach

delete_story_dependency

Remove story dependencies in ServiceNow to manage agile project workflows by deleting specific task relationships using dependency IDs.

Instructions

Delete a story dependency in ServiceNow

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dependency_idYesSys_id of the dependency is required

Implementation Reference

  • Main handler function that performs the DELETE request to remove a story dependency from ServiceNow using the provided dependency sys_id.
    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 model defining the input parameters for the delete_story_dependency tool, requiring the dependency sys_id.
    class DeleteStoryDependencyParams(BaseModel):
        """Parameters for deleting a story dependency."""
    
        dependency_id: str = Field(..., description="Sys_id of the dependency is required")
  • Tool registration in get_tool_definitions dictionary, mapping the tool name to its handler, schema, return type, description, and serialization method.
    "delete_story_dependency": (
        delete_story_dependency_tool,
        DeleteStoryDependencyParams,
        str,
        "Delete a story dependency in ServiceNow",
        "str",
    ),
  • Import of the delete_story_dependency function into the tools package __init__ for exposure.
    from servicenow_mcp.tools.story_tools import (
        create_story,
        update_story,
        list_stories,
        list_story_dependencies,
        create_story_dependency,
        delete_story_dependency,
  • Import aliasing the handler function for use in tool registration.
    delete_story_dependency as delete_story_dependency_tool,
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the action without behavioral details. It doesn't disclose if deletion is permanent, requires specific permissions, has side effects, or what happens on success/failure, leaving critical gaps 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, direct sentence with zero wasted words. It's appropriately sized for a simple tool and front-loads the essential action and resource.

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 lacks behavioral context, usage guidance, and output expectations, making it incomplete despite the concise structure.

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 input schema has 100% description coverage, fully documenting the single parameter 'dependency_id'. The description adds no additional parameter semantics beyond what's in the schema, so it meets the baseline score of 3.

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'), making the purpose unambiguous. 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. It doesn't mention prerequisites (e.g., dependency must exist), exclusions, or related tools like 'create_story_dependency' or 'list_story_dependencies' for context.

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