Tools as a typed registry
In TypeScript, you can encode the tool registry with strict types: each tool's input shape becomes a Zod schema or a TypeScript interface, and the handler signature flows from there. The compile-time check catches half the tool-loop bugs Python finds at runtime.
The same two-round shape
The protocol is identical to Python. Your assistant content list must include the tool_use block; your follow-up user turn carries one tool_result per tool_use_id. The only difference is that TypeScript will not let you build a malformed message — types prevent it.
Zod for input validation
Tools come with input_schema (JSON Schema). Use Zod to validate the model's tool input before invoking the handler — the model is sometimes creative with its arguments, and a Zod parse step turns 'maybe-string maybe-number' into a runtime contract.