# How do I return client tool results and errors to the Claude Messages API?

Exam: CCDV-F — Claude Certified Developer - Foundations
Knowledge domain: Tools and MCPs
Updated: 2026-11-25T08:30:11.665819+00:00
HTML: https://learningpathx.com/faq/CCDV-F/ccdvf-return-client-tool-results.html

## Also asked as

- How do tool\_use and tool\_result blocks match when Claude requests multiple client tools?
- What message ordering does the Claude API expect after a client tool call fails?

For developer-defined client tools, retain the complete assistant turn containing the `tool_use` blocks. Then send the next user message with one `tool_result` for each client call. Set each `tool_use_id` to that call's ID and put all result blocks first in the array. Return `is_error: true` and a safe explanation when the call is invalid or the tool fails. [Handle tool calls](https://platform.claude.com/docs/en/agents-and-tools/tool-use/handle-tool-calls)

If multiple client calls arrive in one turn, collect the results together. If the same turn also has a server tool without a result yet, send only the client result blocks in that user message. Specialized Anthropic-defined toolsets may have extra result fields. Server tools themselves execute on Anthropic infrastructure and use their documented server-result flow. [Handle tool calls](https://platform.claude.com/docs/en/agents-and-tools/tool-use/handle-tool-calls) [How tool use works](https://platform.claude.com/docs/en/agents-and-tools/tool-use/how-tool-use-works)

Return status, identifiers, and only the data needed for the next decision. Preserve untrusted third-party result text inside `tool_result`. Keep secrets and stack traces outside the conversation. When the API reports missing tool results, inspect the stored assistant turn, matching IDs, immediately following user turn, and block ordering. [Handle tool calls](https://platform.claude.com/docs/en/agents-and-tools/tool-use/handle-tool-calls) [Troubleshoot tool use](https://platform.claude.com/docs/en/agents-and-tools/tool-use/troubleshooting-tool-use)

Source: [Implementing Claude Tools with Safe Execution and Approval Patterns](https://learningpathx.com/news/implementing-claude-tools-with-safe-execution-and-approval-patterns.html)
