Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
fix(google): send tool schemas Gemini and Vertex accept (#4751)
## Summary Both Google providers put Composio's JSON Schema into `FunctionDeclaration.parameters`, which only accepts Google's OpenAPI subset. Composio tool schemas carry keywords outside it: `examples`, `const`, `human_parameter_name`, `file_uploadable`, `exclusiveMinimum`, `null` types, and integer enums. With `@composio/google`, Gemini answers 400 `Unknown name "examples"` for the default tools of every popular toolkit. With `composio_google`, `wrap_tool` raises `ParseError` before any request is sent, for 2,604 of 7,212 tools. The TypeScript provider now sends the schema through `parametersJsonSchema`, which takes JSON Schema as-is. The Python provider's `vertexai` `FunctionDeclaration` can only build `parameters`, so it now reduces each schema to the Vertex `Schema` subset. Designated PR reviewer: [@jkomyno](mailto:alberto@composio.dev). Fixes #4750 ## Changes - `ts/packages/providers/google/src/index.ts`: `wrapTool` emits `parametersJsonSchema` instead of `parameters`. The `$ref` dereferencing and the `required` and object-type normalization are unchanged. - `ts/packages/providers/google/package.json` and `pnpm-lock.yaml`: raise the `@google/genai` peer dependency to `^1.6.0`, the first release that supports `parametersJsonSchema` on function declarations. - `ts/packages/providers/google/test/*`: assert the new field, and add a regression test that `examples`, `const`, a `null` branch, and an integer enum reach `parametersJsonSchema` unchanged. - `python/providers/google/composio_google/provider.py`: replace the top-level `examples` strip with `_to_vertex_schema`. It drops unsupported keywords at every depth, maps `oneOf` to `anyOf`, a string `const` to a one-value `enum`, and a `null` type to `nullable`, and drops enums with non-string values. Property names are kept as-is. - `python/tests/test_google_provider.py`: a regression test built from keywords in real tool schemas. It fails on `next` with the `humanParameterName` `ParseError`. - A minor changeset for `@composio/google`, since the declaration field and the peer range change. ## Type of change - [x] Bug fix - [ ] New feature - [ ] Refactor/Chore - [ ] Documentation - [ ] Breaking change ## Checklist - [x] I have read the Code of Conduct and this PR adheres to it - [x] I have read and understand every line of this diff, including any LLM-generated code - [x] Any third-party docs links or promotional content follow the [third-party links policy](https://github.com/ComposioHQ/composio/blob/next/CONTRIBUTING.md#third-party-links-in-docs) - [x] I ran linters/tests locally and they passed - [x] I updated documentation as needed - [x] I added tests or explain why not applicable - [x] I added a changeset if this change affects published packages ## Additional context - Code that reads `wrapped.parameters` from `@composio/google` output now finds the schema in `wrapped.parametersJsonSchema`. Passing the declarations to `functionDeclarations` works as before. - I couldn't call Vertex AI itself. All 7,212 tools from 50 toolkits wrap on `google-cloud-aiplatform` 1.162.0 and 2.2.0, and the Gemini API's `parameters` field, which uses the same `Schema` message, accepted 202 converted schemas. - The Python `composio_gemini` provider is not affected: it hands `google-genai` Python callables instead of schemas. --------- Co-authored-by: jkomyno <alberto@composio.dev>