mongodb-memory-bank-mcp
Version:
FIXED: MongoDB Memory Bank MCP with bulletproof error handling, smart operations, and session state management. Eliminates [object Object] errors and user confusion.
17 lines (16 loc) • 472 B
JavaScript
import { MissingParamError } from "../presentation/errors/index.js";
export class RequiredFieldValidator {
fieldName;
constructor(fieldName) {
this.fieldName = fieldName;
}
validate(input) {
if (!input ||
(input[this.fieldName] !== 0 &&
input[this.fieldName] !== false &&
!input[this.fieldName])) {
return new MissingParamError(this.fieldName);
}
return null;
}
}