Generate schema-valid JSON, call external functions, and constrain decoding to permitted formats. Validate arguments, handle tool errors, and prevent models from performing unauthorized actions.