# How do I format custom client tool results in the Claude Messages API?

Exam: CCAR-F — Claude Certified Architect - Foundations (CCAR-F)
Knowledge domain: Tool Design & MCP Integration
Updated: 2026-11-25T09:22:57.938315+00:00
HTML: https://learningpathx.com/faq/CCAR-F/ccarf-return-claude-tool-results.html

## Also asked as

- How should I return all custom client tool\_result blocks if one Claude tool call fails?
- What goes in the next Claude API message after parallel custom client tool calls?

For custom client tools, append Claude's assistant message, then send the results together in the immediately following `user` message. Return one `tool_result` for every client `tool_use`, even on failure, and set each `tool_use_id` to the ID it answers. Put every result block before any user text. Match parallel results by ID. Execute independent calls in parallel when useful and serialize calls with dependencies or shared effects.

On failure, set `is_error: true` and provide a brief, actionable explanation. For example, a denied lookup can report that the caller lacks access without disclosing another tenant's records. On success, return a small status, identifier or summary that answers the next step. Keep sensitive fields and stack traces outside the model context. Log the correlation ID with the executor's policy decision and observed outcome.

If the assistant turn has a server tool call with no result block yet, the user message must contain only client `tool_result` blocks and the next request must preserve the same `tools` array. Also return a container ID if Claude returned one, and keep the same `mcp_servers` if the pending block is `mcp_tool_use`. Adding text can end the turn early and cause a 400 response for an unresolved directly called server tool. If a request fails with a missing-result error, inspect the adjacent message pair, the complete set of IDs, and block placement before rerunning any tool. Built-in toolset member calls, such as computer or browser use, can impose additional sequencing and result fields.

[Handle tool calls](https://platform.claude.com/docs/en/agents-and-tools/tool-use/handle-tool-calls) · [Parallel tool use](https://platform.claude.com/docs/en/agents-and-tools/tool-use/parallel-tool-use) · [Claude API tool-use continuation](https://platform.claude.com/docs/en/build-with-claude/handling-stop-reasons#tool-use)

Source: [Designing Claude Tool Interfaces and Execution Contracts](https://learningpathx.com/news/designing-claude-tool-interfaces-and-execution-contracts.html)
