Invalid Tool Use Request: Missing Tool Result Block for Tool Use ID
Resolved 💬 3 comments Opened Apr 2, 2025 by Ogyeet10 Closed Jun 11, 2025
Bug Description
When i intturped claudes run of ⏺ Bash(find . -name package.json -type f)… and then tryed to correct it wiht a messeage i had been writing previously and then when i tryed to send the message it failed with " ⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.47: tool_use ids were found without tool_result blocks immediately after: toolu_01QCbpRePUvbgWrpnFA8xVtR. " Plz fix
Environment Info
- Platform: macos
- Terminal: WarpTerminal
- Version: 0.2.59
- Feedback ID: ab898114-f03e-4e82-8158-82e9bbe8fb78
Errors
[{"error":"ShellError: Shell command failed\n at Object.call (file:///Users/aidanleuenberger/node_modules/@anthropic-ai/claude-code/cli.js:1939:899)\n at async Xj5 (file:///Users/aidanleuenberger/node_modules/@anthropic-ai/claude-code/cli.js:3440:4936)\n at async q31 (file:///Users/aidanleuenberger/node_modules/@anthropic-ai/claude-code/cli.js:3440:3472)\n at async FN2 (file:///Users/aidanleuenberger/node_modules/@anthropic-ai/claude-code/cli.js:964:511)\n at async Yj5 (file:///Users/aidanleuenberger/node_modules/@anthropic-ai/claude-code/cli.js:3440:2819)\n at async LS1 (file:///Users/aidanleuenberger/node_modules/@anthropic-ai/claude-code/cli.js:3440:2650)\n at async Dh (file:///Users/aidanleuenberger/node_modules/@anthropic-ai/claude-code/cli.js:3440:1944)\n at async Dh (file:///Users/aidanleuenberger/node_modules/@anthropic-ai/claude-code/cli.js:3440:2318)\n at async Dh (file:///Users/aidanleuenberger/node_modules/@anthropic-ai/claude-code/cli.js:3440:2318)\n at async Dh (file:///Users/aidanleuenberger/node_modules/@anthropic-ai/claude-code/cli.js:3440:2318)","timestamp":"2025-04-02T07:05:39.706Z"},{"error":"Error: Request was aborted.\n at vm._createMessage (file:///Users/aidanleuenberger/node_modules/@anthropic-ai/claude-code/cli.js:865:24058)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-04-02T07:05:46.359Z"},{"error":"ShellError: Shell command failed\n at Object.call (file:///Users/aidanleuenberger/node_modules/@anthropic-ai/claude-code/cli.js:1939:899)\n at async Xj5 (file:///Users/aidanleuenberger/node_modules/@anthropic-ai/claude-code/cli.js:3440:4936)\n at async q31 (file:///Users/aidanleuenberger/node_modules/@anthropic-ai/claude-code/cli.js:3440:3472)\n at async wj5 (file:///Users/aidanleuenberger/node_modules/@anthropic-ai/claude-code/cli.js:3440:2742)\n at async LS1 (file:///Users/aidanleuenberger/node_modules/@anthropic-ai/claude-code/cli.js:3440:2676)\n at async Dh (file:///Users/aidanleuenberger/node_modules/@anthropic-ai/claude-code/cli.js:3440:1944)\n at async d4 (file:///Users/aidanleuenberger/node_modules/@anthropic-ai/claude-code/cli.js:3871:14073)","timestamp":"2025-04-02T07:06:25.264Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.47: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_01QCbpRePUvbgWrpnFA8xVtR. Each `tool_use` block must have a corresponding `tool_result` block in the next message.\"}}\n at C6.generate (file:///Users/aidanleuenberger/node_modules/@anthropic-ai/claude-code/cli.js:861:29204)\n at M6.makeStatusError (file:///Users/aidanleuenberger/node_modules/@anthropic-ai/claude-code/cli.js:865:7207)\n at M6.makeRequest (file:///Users/aidanleuenberger/node_modules/@anthropic-ai/claude-code/cli.js:865:8149)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-04-02T07:10:46.201Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.47: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_01QCbpRePUvbgWrpnFA8xVtR. Each `tool_use` block must have a corresponding `tool_result` block in the next message.\"}}\n at C6.generate (file:///Users/aidanleuenberger/node_modules/@anthropic-ai/claude-code/cli.js:861:29204)\n at M6.makeStatusError (file:///Users/aidanleuenberger/node_modules/@anthropic-ai/claude-code/cli.js:865:7207)\n at M6.makeRequest (file:///Users/aidanleuenberger/node_modules/@anthropic-ai/claude-code/cli.js:865:8149)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async file:///Users/aidanleuenberger/node_modules/@anthropic-ai/claude-code/cli.js:3592:1782\n at async Zp (file:///Users/aidanleuenberger/node_modules/@anthropic-ai/claude-code/cli.js:3589:3801)\n at async Gi2 (file:///Users/aidanleuenberger/node_modules/@anthropic-ai/claude-code/cli.js:3592:1622)\n at async Rv1 (file:///Users/aidanleuenberger/node_modules/@anthropic-ai/claude-code/cli.js:3589:2029)\n at async Ax2 (file:///Users/aidanleuenberger/node_modules/@anthropic-ai/claude-code/cli.js:3590:130)\n at async Vj5 (file:///Users/aidanleuenberger/node_modules/@anthropic-ai/claude-code/cli.js:3440:73)","timestamp":"2025-04
Note: Error logs were truncated.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗