Missing Tool Result Block for Tool IDs in Anthropic API Request

Resolved 💬 3 comments Opened Jul 17, 2025 by tarun-yadav Closed Aug 20, 2025

Bug Description
As I'm trying to request, I keep getting API error 400 of the type "invalid request". The message says, "Tool use IDs were found without tool result blocks immediately after". I think it was expecting the tool use block to have a corresponding tool result in the next message, but it was not there for some reason or got misread, and as a result the chat has suspended normal behavior, so that I cannot continue to chat no matter how I intervene.

Environment Info

  • Platform: darwin
  • Terminal: cursor
  • Version: 1.0.53
  • Feedback ID: c7f24183-0293-4391-9c6d-a5948bc889fb

Errors

[{"error":"Error: Command failed: security find-generic-password -a $USER -w -s \"Claude Code\"\nsecurity: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n\n    at genericNodeError (node:internal/errors:983:15)\n    at wrappedFn (node:internal/errors:537:14)\n    at checkExecSyncError (node:child_process:882:11)\n    at execSync (node:child_process:954:15)\n    at AI (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:728:6320)\n    at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:640:16554\n    at Q (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:542:14406)\n    at MF (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:640:14339)\n    at zX (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:640:13205)\n    at MB (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:640:19174)","timestamp":"2025-07-16T23:18:21.370Z"},{"error":"Error: 1: 1 Error: End of central directory record signature not found. Either not a zip file, or file is truncated.\n    at Ef (file:///Applications/Cursor.app/Contents/Resources/app/out/vs/code/node/cliProcessMain.js:52:28755)\n    at file:///Applications/Cursor.app/Contents/Resources/app/out/vs/code/node/cliProcessMain.js:52:30083\n    at /Applications/Cursor.app/Contents/Resources/app/node_modules/yauzl/index.js:40:7\n    at /Applications/Cursor.app/Contents/Resources/app/node_modules/yauzl/index.js:190:5\n    at Immediate.<anonymous> (/Applications/Cursor.app/Contents/Resources/app/node_modules/yauzl/index.js:705:38)\n    at process.processImmediate (node:internal/timers:483:21) {\n  code: 'Extract',\n  name: 'Extract'\n}\nFailed Installing Extensions: file:///opt/homebrew/lib/node_modules/%40anthropic-ai/claude-code/vendor/claude-code.vsix\n(node:54077) [DEP0168] DeprecationWarning: Uncaught N-API callback exception detected, please run node with option --force-node-api-uncaught-exceptions-policy=true to handle those exceptions properly.\n(Use `Cursor --trace-deprecation ...` to show where the warning was created)\n\n    at Lq6 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1208:5219)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async qq6 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1208:2582)","timestamp":"2025-07-16T23:18:22.831Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"system: Invalid model name\"}}\n    at eQ.generate (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1180:6428)\n    at k$.makeStatusError (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1197:2101)\n    at k$.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1197:5315)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async aB1.showErrors (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2594:14107)\n    at async aB1 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2140:1658)\n    at async qBB (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2594:13956)\n    at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2594:9065\n    at async DIA (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2594:1626)\n    at async Yp (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2594:9035)","timestamp":"2025-07-16T23:18:31.448Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"system: Invalid model name\"}}\n    at eQ.generate (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1180:6428)\n    at k$.makeStatusError (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1197:2101)\n    at k$.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1197:5315)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async aB1.showErrors (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2594:14107)\n    at async aB1 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2140

Note: Error logs were truncated.

View original on GitHub ↗

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