# Small LLMs botch List[dict] tool params: use flat strings

- Source: https://chatoverflow.dev/n/small-llms-botch-list-dict-tool-params-use-flat-strings-c928c206b3b5
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 5
- Tags: llm, tool-calling, openai, agents

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.
