Submit a toolSubmit

Claude API: tool_use ids without tool_result. Return every result next

A 400 means a tool_use id lacks a tool_result in the next user message, or text appears before those results. Fix the history—don’t retry the same payload. Short answer: 5 steps. 1) Read the exact 400 before you rewrite history; 2) Send one tool_result per tool_use in the next user message; 3) Put every tool_result before any text; 4) Leave thinking blocks untouched when you continue; 5) Validate the transcript before every retry.

Last updated: · This page is the decision checklist; the tools list for “Fix Claude API tool_use without tool_result” is a separate URL.

The problem: A 400 means a tool_use id lacks a tool_result in the next user message, or text appears before those results. Fix the history—don’t retry the same payload.

How do I return a tool_result for every tool_use id before I retry?

  1. Read the exact 400 before you rewrite history

    `tool_use ids were found without tool_result blocks immediately after` means at least one assistant `tool_use` (or `tool_result` not first in the user message) is wrong. A related error names a `server_tool_use` that never got a result—often because text after client `tool_result`s ended the turn early, or the resume request dropped that server tool from `tools`. Troubleshooting table: https://platform.claude.com/docs/en/agents-and-tools/tool-use/troubleshooting-tool-use

  2. Send one tool_result per tool_use in the next user message

    After an assistant turn with `stop_reason: tool_use`, your next message must be `role: user` with a `tool_result` for every `tool_use` id from that turn—no other messages in between. Match `tool_use_id` to the `id` on each `tool_use` block. If you skip a call, still return a `tool_result` with `is_error: true` and a short reason. Handle tool calls: https://platform.claude.com/docs/en/agents-and-tools/tool-use/handle-tool-calls

  3. Put every tool_result before any text

    In that user message, all `tool_result` blocks must come first; any explanatory text comes after. Text before a `tool_result` triggers the same 400. For parallel tool calls, put every result in one user message—not one turn per tool. Parallel tool use: https://platform.claude.com/docs/en/agents-and-tools/tool-use/parallel-tool-use

  4. Leave thinking blocks untouched when you continue

    If the 400 says thinking or redacted_thinking blocks in the latest assistant message cannot be modified, you altered the assistant message before appending results. Resend the entire assistant message unchanged, then append your `tool_result`s. For mixed client + server tools, send a user message that contains only the client `tool_result`s and keep the same `tools` array so the server tool can finish.

  5. Validate the transcript before every retry

    Before resending, walk the messages: every `tool_use` id has a following `tool_result`, results sit first in their user message, and you never insert a plain user/assistant turn between a tool call and its results. Treat 400 tool-history errors as non-retryable until the payload is fixed—backoff alone will fail the same way every time.

Which tools are best to fix Claude API tool_use without tool_result?

Troubleshooting tool use

Request-time errors including missing tool_result and server_tool_use cases.

Handle tool calls

Required tool_result shape, ordering, and is_error for skipped calls.

Parallel tool use

Return every parallel result in one user message.

Claude API errors

400 invalid_request_error handling vs retryable statuses.

All tools for “Fix Claude API tool_use without tool_result” →

Related fixes

See also AI tools launched today on the daily board.