Skip to content

Missing Tool Result Block for Tool Use ID #3202

@digi604

Description

@digi604

Bug Description
 Error: String to replace not found in file.
String: # Check columns in fct_products_simple_enhanced
print("=== Columns in fct_products_simple_enhanced ===")
columns = client.query("DESCRIBE default.fct_products_simple_enhanced").result_rows
for col in columns:
print(f"{col[0]:30} {col[1]:30}")

 print("\n=== Sample data ===")
 sample = client.query("SELECT * FROM default.fct_products_simple_enhanced LIMIT 1").result_rows
 if sample:
 … +3 lines (ctrl+r to see all)

⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.141: tool_use ids were found without tool_result blocks immediately after: toolu_01DzVpSGM6B5t6EnCq9WFQ2C.
Each tool_use block must have a corresponding tool_result block in the next message."}}

continue
⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.141: tool_use ids were found without tool_result blocks immediately after: toolu_01DzVpSGM6B5t6EnCq9WFQ2C.
Each tool_use block must have a corresponding tool_result block in the next message."}}

Environment Info

  • Platform: darwin
  • Terminal: intellij
  • Version: 1.0.43
  • Feedback ID: 82ac8bd9-8720-4d1c-b879-713e7c60abeb

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 ED (file:///Users/patricklauber/node_modules/@anthropic-ai/claude-code/cli.js:702:3921)\n    at file:///Users/patricklauber/node_modules/@anthropic-ai/claude-code/cli.js:623:9038\n    at Q (file:///Users/patricklauber/node_modules/@anthropic-ai/claude-code/cli.js:526:13327)\n    at hJ (file:///Users/patricklauber/node_modules/@anthropic-ai/claude-code/cli.js:623:8184)\n    at S_ (file:///Users/patricklauber/node_modules/@anthropic-ai/claude-code/cli.js:623:7265)\n    at NB (file:///Users/patricklauber/node_modules/@anthropic-ai/claude-code/cli.js:623:11432)","timestamp":"2025-07-08T20:16:30.184Z"},{"error":"Error: Error calling tool 'list_databases': 1 validation error for call[list_databases]\nparameters\n  Unexpected keyword argument [type=unexpected_keyword_argument, input_value='{}', input_type=str]\n    For further information visit https://errors.pydantic.dev/2.11/v/unexpected_keyword_argument\n    at zN2 (file:///Users/patricklauber/node_modules/@anthropic-ai/claude-code/cli.js:1385:12840)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async Object.call (file:///Users/patricklauber/node_modules/@anthropic-ai/claude-code/cli.js:1385:9005)\n    at async hq6 (file:///Users/patricklauber/node_modules/@anthropic-ai/claude-code/cli.js:1933:11470)\n    at async Jz1 (file:///Users/patricklauber/node_modules/@anthropic-ai/claude-code/cli.js:1933:8191)\n    at async bq6 (file:///Users/patricklauber/node_modules/@anthropic-ai/claude-code/cli.js:1933:7215)\n    at async fq6 (file:///Users/patricklauber/node_modules/@anthropic-ai/claude-code/cli.js:1933:6844)\n    at async C$ (file:///Users/patricklauber/node_modules/@anthropic-ai/claude-code/cli.js:1933:5217)\n    at async C$ (file:///Users/patricklauber/node_modules/@anthropic-ai/claude-code/cli.js:1933:5939)\n    at async UQ (file:///Users/patricklauber/node_modules/@anthropic-ai/claude-code/cli.js:2551:2590)","timestamp":"2025-07-08T20:28:30.903Z"},{"error":"Error: String not found in file. Failed to apply edit.\n    at jT (file:///Users/patricklauber/node_modules/@anthropic-ai/claude-code/cli.js:1633:728)\n    at rAA (file:///Users/patricklauber/node_modules/@anthropic-ai/claude-code/cli.js:1633:104)\n    at Object.renderToolUseRejectedMessage (file:///Users/patricklauber/node_modules/@anthropic-ai/claude-code/cli.js:1643:3404)\n    at VS2 (file:///Users/patricklauber/node_modules/@anthropic-ai/claude-code/cli.js:1960:2886)\n    at Ew (file:///Users/patricklauber/node_modules/@anthropic-ai/claude-code/cli.js:65:19798)\n    at jP (file:///Users/patricklauber/node_modules/@anthropic-ai/claude-code/cli.js:67:42569)\n    at SP (file:///Users/patricklauber/node_modules/@anthropic-ai/claude-code/cli.js:67:38118)\n    at FL (file:///Users/patricklauber/node_modules/@anthropic-ai/claude-code/cli.js:67:38046)\n    at xw (file:///Users/patricklauber/node_modules/@anthropic-ai/claude-code/cli.js:67:37900)\n    at PW (file:///Users/patricklauber/node_modules/@anthropic-ai/claude-code/cli.js:67:34990)","timestamp":"2025-07-08T20:39:20.863Z"},{"error":"SyntaxError: Unexpected token 'I', \"I apologiz\"... is not valid JSON\n    at JSON.parse (<anonymous>)\n    at file:///Users/patricklauber/node_module

Note: Error logs were truncated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:apiarea:toolsbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:macosIssue specifically occurs on macOS

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions