[Bug] API Error: 400 Each `tool_use` block must have a corresponding `tool_result` block in the next message.

Status Closed — not planned
Maintainer reply None cached
Activity 6 comments · opened Oct 4, 2025 · closed Jan 10, 2026

Bug Description

some PDFs are still being importe as Grayscale and not with proper image.. it is brinng

in only 1 channel. you may have to get all 3-4 chanensl (RGB+Alpha) and map them
correctlty. see iamge '/Users/toddbruss/Library/Mobile
Documents/com~apple~CloudDocs/Documents/GitHub/UFOEmoji2020/UFO Emoji/UFO
Emoji/Assets.xcassets/GameGold/gold.imageset/gold.pdf'
⎿ API Error: 400
{"type":"error","error":{"type":"invalid_request_error","message":"messages.2: tool_use
ids were found without tool_result blocks immediately after:
toolu_01P8CUYNvjiJH6QxQuaye4qF. Each tool_use block must have a corresponding
tool_result block in the next message."},"request_id":"req_011CTmSMQ3wnysHjGDeUxS7U"}

Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 2.0.5
  • Feedback ID: d6279eab-730f-4248-b407-d2ccb13a6eab

Errors

[{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.2: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_01P8CUYNvjiJH6QxQuaye4qF. Each `tool_use` block must have a corresponding `tool_result` block in the next message.\"},\"request_id\":\"req_011CTmSLSgfmhiJiYCPD1L4w\"}\n    at B4.generate (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:895:18688)\n    at yP.makeStatusError (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1034:2131)\n    at yP.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1034:5344)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async E2B.dG1.model (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1120:39804)\n    at async dG1 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1120:27733)\n    at async E2B (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1120:39958)\n    at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1120:34180\n    at async ZH0 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1120:9568)\n    at async r11 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1120:34150)","timestamp":"2025-10-04T03:20:16.758Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.2: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_01P8CUYNvjiJH6QxQuaye4qF. Each `tool_use` block must have a corresponding `tool_result` block in the next message.\"},\"request_id\":\"req_011CTmSMQ3wnysHjGDeUxS7U\"}\n    at B4.generate (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:895:18688)\n    at yP.makeStatusError (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1034:2131)\n    at yP.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1034:5344)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async E2B.dG1.model (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1120:39804)\n    at async dG1 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1120:27733)\n    at async E2B (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1120:39958)\n    at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1120:34180\n    at async ZH0 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1120:9568)\n    at async r11 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1120:34150)","timestamp":"2025-10-04T03:20:29.580Z"}]

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗