@@ -256,6 +256,34 @@ static void test_server_accessors()
256256 std::cout << " PASS\n " ;
257257}
258258
259+ // ============================================================================
260+ // 11. Backward-compatible constructor parameter order
261+ // ============================================================================
262+ static void test_legacy_constructor_compatibility ()
263+ {
264+ std::cout << " test_legacy_constructor_compatibility...\n " ;
265+
266+ std::vector<std::shared_ptr<providers::Provider>> providers;
267+ FastMCP app_with_vector (" legacy_app_vector" , " 1.0.0" , std::nullopt , std::nullopt , providers, 3 ,
268+ false );
269+ assert (!app_with_vector.instructions ().has_value ());
270+ assert (app_with_vector.list_page_size () == 3 );
271+ assert (!app_with_vector.dereference_schemas ());
272+
273+ FastMCP app_with_braces (" legacy_app_braces" , " 1.0.0" , std::nullopt , std::nullopt , {}, 0 ,
274+ false );
275+ assert (!app_with_braces.instructions ().has_value ());
276+ assert (app_with_braces.list_page_size () == 0 );
277+ assert (!app_with_braces.dereference_schemas ());
278+
279+ server::Server legacy_srv (" legacy_srv" , " 1.0.0" , std::nullopt , std::nullopt , true );
280+ assert (!legacy_srv.instructions ().has_value ());
281+ assert (legacy_srv.strict_input_validation ().has_value ());
282+ assert (*legacy_srv.strict_input_validation ());
283+
284+ std::cout << " PASS\n " ;
285+ }
286+
259287int main ()
260288{
261289 test_bare_handler_with_instructions ();
@@ -268,6 +296,7 @@ int main()
268296 test_proxy_instructions ();
269297 test_proxy_set_instructions ();
270298 test_server_accessors ();
299+ test_legacy_constructor_compatibility ();
271300
272301 std::cout << " All instructions tests passed\n " ;
273302 return 0 ;
0 commit comments