xml – Is it possible to call a function in android shortcuts?

I don’t want to open an activity when a shortcut is clicked, instead I want a function to be called to perform certain operations. Is that possible ?

val shortcut3 = ShortcutInfo.Builder(context, website)
            .setIcon(Icon.createWithResource(context, R.drawable.anxious))
            .setIntent(Intent(Intent.ACTION_VIEW, null, context, MainActivity::class.java))

Here instead of setIntent, I want to call a specific funcction. How to achieve it?