Invalid Tool Result Block: Missing Corresponding Tool Result for Tool Use ID
Resolved 💬 4 comments Opened Jun 16, 2025 by dsvua Closed Jun 17, 2025
Bug Description
⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.41: tool_use ids were found without tool_result blocks immediately after:
toolu_01UH1ch5PqbZyt6xYL3iSz93. Each tool_use block must have a corresponding tool_result block in the next message."}}
Environment Info
- Platform: linux
- Terminal: gnome-terminal
- Version: 1.0.24
- Feedback ID: 6844dcc1-15a0-4ec8-936d-d6dd00345dbd
Errors
[{"error":"Error: Request was aborted.\n at mo._createMessage (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1335:6810)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","timestamp":"2025-06-16T14:25:40.110Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.41: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_01UH1ch5PqbZyt6xYL3iSz93. Each `tool_use` block must have a corresponding `tool_result` block in the next message.\"}}\n at h6.generate (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1329:12578)\n at Lw.makeStatusError (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1344:2082)\n at Lw.makeRequest (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1344:5257)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async ME2.K11.showErrors (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1698:22008)\n at async K11 (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1698:12203)\n at async ME2 (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1698:21854)\n at async file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1698:17103\n at async yt1 (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1698:5151)\n at async Fu (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1698:17073)","timestamp":"2025-06-16T16:43:08.896Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.41: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_01UH1ch5PqbZyt6xYL3iSz93. Each `tool_use` block must have a corresponding `tool_result` block in the next message.\"}}\n at h6.generate (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1329:12578)\n at Lw.makeStatusError (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1344:2082)\n at Lw.makeRequest (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1344:5257)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async ME2.K11.showErrors (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1698:22008)\n at async K11 (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1698:12203)\n at async ME2 (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1698:21854)\n at async file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1698:17103\n at async yt1 (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1698:5151)\n at async Fu (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1698:17073)","timestamp":"2025-06-16T16:43:23.568Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.41: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_01UH1ch5PqbZyt6xYL3iSz93. Each `tool_use` block must have a corresponding `tool_result` block in the next message.\"}}\n at h6.generate (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1329:12578)\n at Lw.makeStatusError (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1344:2082)\n at Lw.makeRequest (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1344:5257)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async ME2.K11.showErrors (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1698:22008)\n at async K11 (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1698:12203)\n at async ME2 (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1698:21854)\n at async file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1698:17103\n at async yt1 (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1698:5151)\n at async Fu (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1698:17073)","timestamp":"2025-06-16T16:43:29.301Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.41: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_01UH1ch5PqbZyt6xYL3iSz93. Each `tool_use` block must h
Note: Error logs were truncated.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗