Skip to content
LearningPathX
Learning PathsFree TestsExam InfoHow it worksNews
Sign inChoose a certification
  1. Home/
  2. Certifications/
  3. CCAR-F/
  4. CCAR-F Learning Path/
  5. Study FAQs/
  6. How do I format custom client tool results in the Claude Messages API?

Study FAQ

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

Exam · CCAR-FKnowledge domain · Tool Design & MCP IntegrationUpdated Nov 25, 2026
Also asked as 2
  • 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?

Answer

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 · Parallel tool use · Claude API tool-use continuation

Full explanation

Designing Claude Tool Interfaces and Execution Contracts

Study guide · CCAR-F

Read the full explanation →
← Back to CCAR-F FAQsView learning path →

Related questions

Who executes Claude API tools, and where should authorization happen? →How do I design a narrow input contract for a Claude client tool? →Where should an MCP integration enforce consent, access, and isolation? →How do MCP hosts, clients, and servers divide responsibilities and expose capabilities? →How does MCP 2025-06-18 initialization negotiate versions and capabilities? →What should a Claude tool executor do when a write times out? →
LearningPathX

A focused path to certification, one clear step at a time.

© 2026 LearningPathX. All rights reserved.

Product

CertificationsLearning PathsFree TestsHow it worksNews

Company

SubscriptionHelp centerContact usPrivacyTerms

Follow us

Your privacy choices

We use analytics cookies to understand how LearningPathX is used and improve your learning experience. Analytics will only start after you accept.