File tree Expand file tree Collapse file tree 2 files changed +6
-11
lines changed
Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Original file line number Diff line number Diff line change 2323
2424 // TODO Register your tool here and add it to the collection
2525
26- $ image_tools = new ImageTools ($ client );
26+ $ all_tools = [
27+ ...(new ImageTools ($ client ))->get_tools (),
28+ ...(new MapRESTtoMCP ())->map_rest_to_mcp (),
29+ ];
2730
28- foreach ( $ image_tools -> get_tools () as $ tool ){
31+ foreach ( $ all_tools as $ tool ) {
2932 $ tools ->add ($ tool );
3033 }
3134
32-
33- // WordPress REST calls
34- $ rest_tools = new MapRESTtoMCP ();
35-
36- foreach ( $ rest_tools ->map_rest_to_mcp () as $ tool ) {
37- $ tools ->add ( $ tool );
38- }
39-
4035 $ ai_command = new AiCommand (
4136 new CollectionToolRepository ( $ tools ),
4237 $ server ,
Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ static function () {
107107 rename ( $ filename , $ filename . '. ' . $ extension );
108108 $ filename .= '. ' . $ extension ;
109109
110- // file_put_contents( $filename, $image_blob->get_binary_data() );
110+ file_put_contents ( $ filename , $ image_blob ->get_binary_data () );
111111
112112 $ image_url = $ filename ;
113113 $ image_id = \WP_CLI \AiCommand \MediaManager::upload_to_media_library ($ image_url );
You can’t perform that action at this time.
0 commit comments