Claude API Tool Calls: Text + Tool_Use Blocks Explained?
Claude tool responses use multi-block messages with text and tool_use—essential format for handling API tool integrations beyond simple text outputs.
Question
When Claude uses a tool, what type of message structure does it return?
A. Multi-block messages with text and tool use blocks
B. Simple text-only responses
C. JSON data without any text
D. Error messages only
Answer
A. Multi-block messages with text and tool use blocks
Explanation
When Claude invokes a tool via the Messages API, it returns a multi-block message structure containing both a text block for any explanatory content and a tool_use block specifying the tool name and input parameters (e.g., {“name”: “calculator”, “input”: {“expression”: “2+2”}}), enabling the client to execute the tool and feed results back in the conversation. This hybrid format supports natural dialogue around tool usage, unlike text-only (B, no tools), JSON-only (C, lacks explanation), or errors (D, normal flow), as per Anthropic’s tool integration design for seamless agentic workflows.