Best prompt to avoid invalid/undefined values in a JSON response?

If you define your output as a complete JSON schema, suitable for validating the AI output, you can add description and example fields. Additionally, you can specify which properties are required. The contrast between some properties and values being required and others not being specified may inform the AI of what is optional, in addition to the descriptions.

Furthermore, you can specify where the information to complete the output should be sourced from. This could be from AI knowledge, a reproduction from user input or user chat history, or from documentation currently seen in context. You can define if a function should be called if the resources are not available to fill a property, or if the AI must continue interviewing the user to obtain more information before issuing a function send.