Troubleshooting
Common issues
invalid_request_error when setting tool_choice
tool_choicecannot name a tool whoseallowed_callersomits"direct". Either add"direct"to that tool'sallowed_callers, or remove the tool fromtool_choiceand let Claude invoke it from code.
Container expiration
- Respond to each programmatic tool call well before the paused response's
expires_attimestamp. Claude's code stops waiting for a result after about 4 minutes, and idle containers are currently reclaimed after about 5 minutes. - Consider implementing faster tool execution
Tool result not parsed correctly
- Ensure your tool returns string data that Claude can deserialize
- Provide clear output format documentation in your tool description
Debugging tips
- Log all tool calls and results to track the flow
- Check the
callerfield to confirm programmatic invocation - Monitor container IDs to ensure proper reuse
- Test tools independently before enabling programmatic calling