Feeding the tool arguments interrupted

Pretty consistently, I get an error like this when calling a tool:

Action Input: {"tail": "ARGUME12024-10-15 19:14:55,670 - 127923010462336 - __init__.py-__init__:1236 - WARNING: SDK is disabled.

where the action input seems to get interrupted/truncated by a warning. That results in a Pydantic error because the tool has 2 parameters instead of 1. Because of self-healing it is later on able to overcome that by trying again this time w/o truncation. However, instead of using the full first argument, it accepts the previous, truncated one. For this example, it uses

ARGUME

instead of

ARGUMENT

I naively tried disabling the warnings but they did not disable to begin w/.

what llm were you using?

I have no choice in this but it is an open source one.

Seems to me this sort of behavior is often caused by llm’s that are not good at function calling/tool use. Try adding to your system prompt,
When you are using a tool, you MUST use valid JSON format for your input to the tool.

Sometimes this helps, sometimes not depending on the llm.

This is news for me. I have not been using JSON at all. Do you have any doc reference for this?

no reference. the tools need input to be structured when they are called. any llm does its best to comply with instructions and create the proper format for inputs to pass to a tool. this sometimes helps. crewai is telling the llm to do the formatting correctly based on the tool parm inputs. sometimes the llm does it correctly, sometimes not. depends on how adept the llm is at tool use.