Everything a request carries arrives through c.req. c.req.query('limit') returns the query value as text or undefined when the client left it out, and c.req.header('x-request-id') reads a header without caring about its letter case. Text values need checking before you use them as numbers: ?limit= is an empty string, not a missing value, and ?limit=ten is text that only looks like a setting.
The context also builds the response. c.json(body, status) sends JSON, c.text(text, status) sends plain text, c.header(name, value) adds a response header, and c.redirect(url, 301) sends a redirect with a location header and an empty body.
In these tasks the send helper can return selected response headers, so the checks see headers as well as status and body.
Missing, malformed and valid values are three cases. Decide each one before converting text to a number.