nexus-agents - v2.80.0
    Preparing search index...

    Function createValidator

    MCP exports - MCP server implementation Split from index.ts for file size compliance (Issue #285) Updated Issue #538: Added missing tool registration exports

    • Creates a validation function bound to a specific schema.

      Useful for reusing the same schema across multiple tools.

      Type Parameters

      • T

        The expected type after validation

      Parameters

      • schema: ZodType<T>

        The Zod schema to bind

      Returns (args: unknown) => Result<T, ValidationError>

      A validation function for the schema

      const validateTask = createValidator(TaskSchema);

      // Later in tool handlers:
      const result = validateTask(args);