Fail Safely, Never Hang
Guard against timeouts and unhandled exceptions.
A Hung Tool Is Worse Than a Failed One
A tool that errors clearly lets the model move on. A tool that hangs freezes the whole call, so always design for a timely exit.
Catch the Unexpected
Wrap risky work so a surprise exception becomes a clean error, not a crash. The server stays up and the model learns what failed.
try:
data = parse(raw)
except Exception as e:
raise ValueError("could not parse input")All lessons in this course
- Tool Errors the Model Can See
- Protocol Errors vs Tool Failures
- Validate Inputs Before Acting
- Fail Safely, Never Hang