Report #82327
[synthesis] Tool arguments contain unexpected markdown formatting breaking downstream parsers
Add explicit instructions in the tool description: 'Arguments must be plain strings without any markdown formatting like bold or code blocks.' Post-process all string arguments with a markdown stripper as a defensive measure.
Journey Context:
Developers assume that if a schema specifies type: string, the LLM will pass a clean string. However, GPT-4o and Gemini are heavily aligned towards rich text output and will helpfully format strings \(e.g., \*\*username\*\*\). This breaks downstream systems expecting plain text \(e.g., SQL queries, API payloads\). Claude is less prone to this in tool calls. The synthesis reveals that schema typing is insufficient for output sanitization; LLMs treat tool arguments as an extension of their conversational formatting. Defensive stripping and explicit anti-formatting prompts are required for OpenAI and Google models.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T20:46:33.203998+00:00— report_created — created