delete_story_dependency
Remove story dependencies in ServiceNow to manage agile project relationships and maintain accurate workflow connections.
Instructions
Delete a story dependency in ServiceNow
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dependency_id | Yes | Sys_id of the dependency is required |
Implementation Reference
- The handler function that implements the delete_story_dependency tool. It validates parameters, constructs the API URL, and sends a DELETE request to the ServiceNow m2m_story_dependencies table.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 schema for the delete_story_dependency tool, requiring the sys_id of the dependency.class DeleteStoryDependencyParams(BaseModel): """Parameters for deleting a story dependency.""" dependency_id: str = Field(..., description="Sys_id of the dependency is required")
- src/servicenow_mcp/utils/tool_utils.py:872-878 (registration)Registration of the delete_story_dependency tool in the central tool_definitions dictionary used by the MCP server, including the aliased function, params model, return type, description, and serialization method."delete_story_dependency": ( delete_story_dependency_tool, DeleteStoryDependencyParams, str, "Delete a story dependency in ServiceNow", "str", ),