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

Study FAQ

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

Exam · CCDV-FKnowledge domain · Tools and MCPsUpdated Nov 25, 2026
Also asked as 2
  • 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?

Answer

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

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 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 Troubleshoot tool use

Full explanation

Implementing Claude Tools with Safe Execution and Approval Patterns

Study guide · CCDV-F

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

Related questions

How should a remote MCP server authorize each request? →When should I choose an MCP server over a built-in tool, custom tool, Skill, or plugin? →When should an MCP server use stdio, Streamable HTTP, or a custom transport? →How should an MCP host and server expose tools, resources, and prompts? →How does an MCP 2026-07-28 server ask for more client input during a request? →How do MCP 2026-07-28 clients discover server capabilities without an initialize session? →
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.