requireString function
Reads a string that must be present and non-blank.
Implementation
String requireString(JsonMap input, String key) {
final value = readString(input, key);
if (value == null || value.trim().isEmpty) {
throw ToolFailure('`$key` is required.');
}
return value;
}