- Keep free-form object roots, patternProperties, and additionalProperties when parsing a tool schema, and make properties optional in the ToolSchema type to reflect valid property-less object schemas
- Reuse fetched tool schemas when provider-wrapped tools execute to avoid redundant retrieval requests
- Add type: "object" to nested JSON Schema nodes that carry properties without an explicit type for compatibility with strict OpenAPI 3.0 consumers like Google Gemini
Minor Changes
-
5e57815: Keep free-form object roots,
patternProperties, andadditionalPropertieswhen parsing a tool schema.ToolSchema.parseused to reject a bare{ "type": "object" }root, drop rootpatternPropertiesas an unknown key, and reject a rootadditionalPropertieswritten as a schema instead of a boolean. Free-form roots now parse successfully, and both constraints survive parsing exactly as written. The publicToolSchematype now makespropertiesoptional to reflect those valid property-less object schemas.This matters downstream. Every provider reads
inputParametersafter parsing, so a tool that declares dynamic keys had those rules stripped before the model ever saw them.An omitted
additionalPropertiesstill stays omitted. The parser does not invent a value, because each converter decides its own default.What no longer works
Parsing no longer fails on a schema-valued root
additionalProperties.const tool = ToolSchema.parse({ slug: 'MY_TOOL', inputParameters: { type: 'object', properties: { name: { type: 'string' } }, additionalProperties: { type: 'number' }, }, // ... }); // before: parsing failed, because only a boolean was accepted // now: tool.inputParameters.additionalProperties is { type: 'number' }What to do instead
Nothing, if you only ever passed boolean values. That case is unchanged.
If your code assumed
inputParametersnever carriespatternProperties, or thatadditionalPropertiesis always a boolean, widen that assumption. Both keywords can now appear, andadditionalPropertiescan be a boolean or a schema object.
Patch Changes
- a2f6b96: Add
type: "object"to nested JSON Schema nodes that carrypropertieswithout an explicit type, so tool schemas work with strict OpenAPI 3.0 consumers like Google Gemini. - c625edc: Reuse fetched tool schemas when provider-wrapped tools execute to avoid a redundant retrieval request.
- Updated dependencies [5e57815]
- @composio/json-schema-to-zod@0.3.0