After a lot of experiments, I get the same errors with the built-in tags
tool, so there’s nothing wrong with my custom tool. All tools that take parameters work as expected. The common thing between tags
and my custom tool is that neither takes any parameters.
I believe the bot has to be pretty bright to call a function with no parameters. gpt-4o is able to use those tools with no problem. But flash 1.5 and 2.0 and haiku always fail. Sonnet usually fails but got it right once.
The errors are always one of the following:
or:
An empty string is not a valid JSON string.
I’m under the impression the bots aren’t sure what to pass to a function that takes no parameters- null? An empty string? An empty object? Empty json {}?