This is a trivial example, but is meant to demonstrate how you can pipe arguments to a bash function.

#!/usr/bin/env bash

function lowercase()
{
    # Grab input.
    declare INPUT=${1:-$(</dev/stdin)};

    # Use that input to do anything.
    echo "$INPUT" | tr '[:upper:]' '[:lower:]'
}

echo "HELLO there, FRIEND!" | lowercase

Which outputs the following.

hello there, friend!