export function assertRecord(input) {
    if (!input || typeof input !== 'object' || Array.isArray(input)) {
        throw new Error('Tool input must be an object.');
    }
    return input;
}
export function readRequiredString(value, field) {
    if (typeof value !== 'string' || !value.trim())
        throw new Error(`${field} is required.`);
    return value.trim();
}
export function readString(value, field) {
    if (typeof value !== 'string')
        throw new Error(`${field} must be a string.`);
    return value;
}
export function readOptionalString(value) {
    return typeof value === 'string' && value.trim() ? value.trim() : undefined;
}
export function readStringOrDefault(value, fallback) {
    return typeof value === 'string' ? value : fallback;
}
export function normalizeSearchText(value) {
    return (value ?? '').trim().toLowerCase();
}
//# sourceMappingURL=input-helpers.js.map