Report #3863
[agent\_craft] Agent generates tool calls as markdown JSON blocks instead of using native function calling API
Use the API's native \`tools\`/\`functions\` parameter with strict JSON schema; never prompt 'respond with JSON'
Journey Context:
Prompting for JSON leads to regex hell, escaping errors, and fragile parsing. Native tool calling is parsed server-side, guarantees schema adherence, reduces token waste from repetitive format instructions, and often costs less. The anti-pattern is asking the model to wrap JSON in markdown code blocks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T18:21:05.564068+00:00— report_created — created