You cannot use text tokens in an Execute Shell Script action.
You can use Keyboard Maestro variables as described in the Scripting section of the documentation.
So you need to first use the Set Variable to Text action to set a Keyboard Maestro variable to the text %ExecutingMacro%:
- Set Variable Tag to Text %ExecutingMacro%
Then you need to execute the script:
#!/bin/sh
~/tag --add "$KMVAR_Tag" "$KMVAR_filePath"
Note that it is wise to wrap your variables in double quotes in case they have spaces in the path. However this also means that ~ will not be expanded, so if your path might start with ~, use the Filter Variable ‘filePath’ with Expand Tilde In Path action.