Report #39245
[gotcha] LLM generates malformed JSON for tool inputs with untyped object parameters
Avoid additionalProperties: true or generic \{\} types in inputSchema. Define explicit arrays of key-value pairs or strongly typed objects with specific property names.
Journey Context:
When a tool requires a generic dictionary or map \(e.g., headers or metadata\), developers naturally define it as type: object, additionalProperties: \{type: string\}. LLMs struggle immensely with this, often generating invalid JSON, nesting objects incorrectly, or omitting the key-value structure entirely. The fix is counter-intuitive: instead of a generic object, define the input as an array of objects like \[\{ key: name, value: alice \}\]. This explicit structure dramatically increases the LLMs reliability in generating valid arguments.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T20:20:38.503388+00:00— report_created — created