[ ABORT TO HUD ]
SEQ. 1
SEQ. 2

Parallel Executions & Exceptions

🔧 Advanced Tool Use⏱ 10 min⭐ 550 BASE XP⌨ HANDS-ON LAB

High-Throughput Action Loops

Claude 3.7 Sonnet and Claude 3.5 Sonnet support Parallel Tool Use, allowing the model to trigger multiple tools (e.g., searching 3 distinct databases) in a single turn. While powerful, this can be complex to handle. If your backend cannot handle concurrency, you should set disable_parallel_tool_use: true to force Claude to iterate through actions one-by-one.

Handling Terminal Failures

When a tool call fails in your code (e.g., a database timeout), you must feed that error back to Claude using the is_error: true property in the tool_result object. This prevents Claude from hallucinating fake data and instead triggers a 'recovery' reasoning path where it might try a different tool or notify the user.

Tool Definition Structure

{
  "tools": [
    {
      "name": "lookup_customer",
      "description": "Look up customer account details by ID",
      "input_schema": {
        "type": "object",
        "properties": {
          "customer_id": { "type": "string", "description": "Unique customer identifier" }
        },
        "required": ["customer_id"]
      }
    }
  ]
}
⌨ HANDS-ON LABReturn Tool Results & Handle Exceptions
⭐ +200 XP

Claude invoked a tool. Complete the cycle by sending a user turn containing the tool_result content block matching tool_use_id.

1Send a user message containing a tool_result block with tool_use_id 'toolu_01WeatherReq' and the tool execution output.
lab-sandbox — simulated environment
INFINITY LAB SANDBOX v2.6 — simulated shell
Type the command for the current objective. Helpers: "hint", "solution", "clear".
$
OBJECTIVE 1 / 1 — type "hint" if stuck
SYNAPSE VERIFICATION
QUERY 1 // 2
How do you correctly feed a result from your code back to Claude?
Send an email
Inject a 'tool_result' object into a subsequent 'user' message, mapped via 'tool_use_id'
Add to system prompt
Modify API URL