Skip to content

Commit f434586

Browse files
committed
Output which tool was used for the response
1 parent 4fbcde6 commit f434586

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/MCP/Client.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,10 @@ static function () {
205205
} elseif ( $part instanceof Function_Call_Part ) {
206206
$function_result = $this->{$part->get_name()}( $part->get_args() );
207207

208+
// Capture the function name here
209+
$function_name = $part->get_name();
210+
echo "Output generated with the '$function_name' tool:\n"; // Log the function name
211+
208212
// Odd limitation of add_function_response_part().
209213
if ( ! is_array( $function_result ) ) {
210214
$function_result = [ $function_result ];

0 commit comments

Comments
 (0)