Skip to content

Commit a944304

Browse files
committed
Merge branch 'main' into feature/docs
2 parents 92178ed + 4f12113 commit a944304

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

ai-command.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,15 @@
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,

src/MCP/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)