You are calling entr from a shell script. When the shell performs variable substitution (or parameter expansion in the manual), `$0` will expand to the filename of the script. To protect the `$0` from variable substitution by the shell, use `\`:
find . -name "*.md" | entr -r -s "my_function \$0"
**Edit:** As @roaima reminded, another way is to use single quotes, which protects the entire quoted text:
find . -name "*.md" | entr -r -s 'my_function $0'
**NB:** If the `SHELL` environment variable is set to something incompatible with bash, `typeset -fx my_function` might not work at all for entr (for example, it doesn't work with `SHELL=/bin/mksh`). Also, consider adding a shebang) to your script, and leaving out the unnecessary word `function`:
#!/bin/bash
my_function(){
echo "I've just seen $1"
}
typeset -fx my_function
find . -name "*.md" |
entr -r -s "my_function \$0"