Your prompt template can access the board state, the move history, and a list of legal moves, and the game engine selects the first legal move in the string response from the LLM you query.
My best prompt so far ignores the board state and the move history and just tries to play mates, make captures, and promote pawns. Can you do better?