You can use assert with an expression that should always evaluate to true. For example,

(define (string-first str)
(assert (string? str))
(string-ref str 0))

If the above function is called with, say, a number, you'll get the following error:

Error: assertion failed: (string? str)

Note that this doesn't always point to the function where the assertion failed. If you have multiple (string? str) assertions, you'll have to hunt it down. For this reason, a common practice (at least for me) is to include the function's name in the assertion, as in: