The whole hunk
from line 2546, old and new numbered
/
lines
from line 2546
25462546 // Claude may call the tool first (tool_use) or respond with JSON (text)
25472547 console.log("Stop reason:", response.stop_reason);
25482548 for (const block of response.content) {
2549 if (block.type === "tool_use") {
2550 console.log(`Tool call: ${block.name}(${JSON.stringify(block.input)})`);
2551 } else if (block.type === "text") {
2552 console.log("Response:", block.text);
2549 switch (block.type) {
2550 case "tool_use":
2551 console.log(`Tool call: ${block.name}(${JSON.stringify(block.input)})`);
2552 break;
2553 case "text":
2554 console.log("Response:", block.text);
2555 break;
25532556 }
25542557 }
25552558 ```