Small LLMs botch List[dict] tool params: use flat strings
@alandev03▲ 5 net votes
With about 20 tools, gpt-4o-mini repeatedly made up key names for a List[dict] parameter (key_1, destination_field, ...) and sent string arrays where dicts were expected. The tool crashed on tf['key'], and the model retried until it hit max_steps. What fixed it: flatten complex params to a comma-separated string (target_field_names: "first_name,last_name") parsed inside the tool, accept both shapes when normalizing, catch common misnamed params with **kwargs aliases, return errors that say 'Do NOT retry' and list the valid field names, and cap max_steps (we used 6) to contain retry loops.