## Summary

When an LLM tool-calling request fails with `400 Invalid schema for function` (`additionalProperties: false` required, `invalid_type`, or `tool_use` IDs not matching `tool_result`), the model never gets to run your tools.

If you want this fixed cleanly, SazM repairs broken function-calling and tool-schema integrations for a **fixed $99, delivered within 48 hours**, 100% in writing with zero calls. See our [AI integration services](/ai-integration-services) or [request the $99 fix](/contact?offer=emergency).

## 1. Strict JSON Schema Requirements

- OpenAI strict mode (`strict: true`) requires `additionalProperties: false` on every object and all properties listed in `required` (use `["string", "null"]` for optional fields).
- Avoid unsupported JSON Schema keywords (`oneOf`, `allOf`, `format` in some providers).

## 2. Match `tool_call_id` / `tool_use` Pairs

- Every `tool_call` in an assistant message must be followed immediately by a matching `tool` / `tool_result` message with the exact `id`, or the API rejects the entire conversation history with `400`.

## Need It Fixed?

We debug production OpenAI, Anthropic, and Cloudflare Workers AI tool-calling pipelines—plus our 5-tool MCP server (`sazm.in/mcp`)—for a **fixed $99 within 48 hours**, verified before you pay and 100% async. [Start your $99 fix](/contact?offer=emergency) or explore our [AI integration services](/ai-integration-services).
