Error in any AI Tool with no parameters, e.g. "tags"

EDIT- Now I understand this happens with the built-in tags AI Tool also, not just my custom tool. Please skip ahead to my second post.

I have two custom AI Tools- one with parameters and one with no parameters. Both pass with the Run Test button. But when a bot tries to use the tools, the first one works, and the second fails with:

I see the troubleshooting tips at AI bot - Custom tools.

  • The Test interface passes with Success.
  • My group is in ai_bot_debugging_allowed_groups, but I don’t know where the bot transcripts are.
  • /logs just has the same error shown above.

I tried adding a dummy parameter, same result.

Up-to-date with 3.5.0.beta1-dev. Using Gemini 2.0 Flash.


function invoke(params) {
    const url = `https://example.com/investments/sponsors`;
    let result = http.get(url);
    return result;
}

function details() {
    return "Returns sponsors.";
}

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 {}?

will write an eval here, thank for raising!