Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
docs(vercel): state that strict mode does not turn on schema enforcement (#5028)
## Summary The docs for `VercelProvider({ strict: true })` imply that it turns on strict structured outputs. It doesn't. The option rewrites each tool's input schema into the form OpenAI strict mode accepts, but the provider never sets the AI SDK's per-tool `strict` flag. Both `@ai-sdk/openai` and `@ai-sdk/anthropic` send the vendor's `strict` only when that flag is set, so with this option on, nothing is enforced. This PR fixes the docs only. It changes no behavior and has no changeset. - `ts/packages/providers/vercel/README.md` and `docs/content/docs/providers/vercel.mdx`: - Replace "Some models reject tool schemas that contain optional parameters" with what the option does. - Add a paragraph: - The option doesn't set the per-tool flag. - It does change local validation: tool-call arguments are checked against the rewritten schema, so a call that leaves out an optional parameter instead of sending `null` fails, and the `null`s are dropped before the tool runs. - If users set it themselves, they should do so only with OpenAI models, and only on tools that didn't log the fallback warning. - They should not set it for Anthropic models. - `ts/packages/providers/vercel/src/index.ts`: add an `@param options.strict` to the constructor JSDoc. ## Why not set the flag in the provider I tested this live against Anthropic (claude-haiku-5-5) and OpenAI with AI SDK 7, using `@ai-sdk/anthropic` 4.0.84 and `@ai-sdk/openai` 4.0.75. I took the tool schemas from the 930-tool fixture in `ts/packages/cli/test/__mocks__/tools.json`. - **Today, without the flag:** the strict-rewritten `GOOGLEDRIVE_CREATE_DRIVE` gets a 200 from both vendors. - **With `strict: true` set on the tool:** OpenAI returns 200. Anthropic returns 400 because of `minimum`/`maximum`. - **Anthropic strict mode limits the whole request, not just each tool.** Across all strict tools in a request: - More than 16 parameters with union types (type arrays or `anyOf`) → 400, "Schemas contains too many parameters with union types". - More than 24 optional parameters → 400. - Recursive `$defs` → 400, "Circular reference detected". - **Anthropic strict mode also rejects these keywords:** - Numbers: `minimum`, `maximum`, `exclusiveMinimum`, `exclusiveMaximum`, `multipleOf`. - Arrays: `maxItems`, `uniqueItems`, `minItems` other than 0 or 1. - Objects: `minProperties`, `maxProperties`. - `enum` values that are objects, a type array combined with `enum`, and regexes with lookahead. - **It accepts:** `minLength`, `maxLength`, a simple `pattern`, `format: uri` and `email`, `contentEncoding`, and the annotations `title`, `default` and `examples`. - **The strict rewrite makes every optional parameter a union with `null`.** - Across the 816 tools the rewrite can express, that averages 1.7 union parameters per tool (median 0, p90 4, max 41). 6 tools go over 16 on their own. - The first ten Google Drive tools total 23 union parameters. - So a request with about ten typical Composio tools would hit Anthropic's limit. If the provider set the flag, Anthropic requests that work today would start failing. Moving `minimum`/`maximum` into descriptions wouldn't fix the union and optional limits. Doing it while the flag is off would only take hints away from the model. OpenAI users who want enforcement can set the flag themselves; the new docs say when that is safe. ## Test plan - [x] Prettier check on the README and `index.ts`. `vercel.mdx` already fails the check on `next`, and this PR leaves its formatting unchanged. - [x] Live AI SDK 7 probe of OpenAI and Anthropic, with and without the per-tool `strict` flag (results above).