Skip to content

Commit 2942d45

Browse files
committed
JSON body fix in examples/http_server.rb
1 parent 91af9ad commit 2942d45

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/http_server.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def template(args, server_context:)
125125

126126
# Log the MCP response details
127127
_, _, body = response
128-
if body.is_a?(Array) && !body.empty?
128+
if body.is_a?(Array) && !body.empty? && body.first
129129
begin
130130
parsed_response = JSON.parse(body.first)
131131
if parsed_response["error"]

0 commit comments

Comments
 (0)