The thing is this isn't a schema generation or Typescript bug at all. This is just how openai's function calling works under the hood. Their weights were fine-tuned for tool use to output the most complete data structures possible. If the model sees a parameter name in the system prompt context it will try to fill it with a value, even if it is not in the required array