Skip to content
This repository was archived by the owner on Jun 3, 2026. It is now read-only.

feat(tools): add fromJsonSchema helper for FunctionTool#735

Open
tristanreid wants to merge 1 commit into
strands-agents:mainfrom
tristanreid:feat/from-json-schema
Open

feat(tools): add fromJsonSchema helper for FunctionTool#735
tristanreid wants to merge 1 commit into
strands-agents:mainfrom
tristanreid:feat/from-json-schema

Conversation

@tristanreid

Copy link
Copy Markdown

Description

Adds fromJsonSchema(), a small factory for building a FunctionTool when your tool definitions already use a schema field instead of inputSchema. It maps schemainputSchema and delegates to the existing constructor, so behavior matches new FunctionTool({ … }) exactly.

Also introduces FromJsonSchemaConfig and exports fromJsonSchema and FromJsonSchemaConfig from the package entry point.

Unit test asserts parity with the constructor for name, description, and toolSpec.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe)

Testing

  • npm run check (with Node v20.19.6; Vitest/Rolldown require ≥ 20.19 per engine fields)

Checklist

  • I have read the CONTRIBUTING document
  • I have added tests that prove the feature works
  • I have updated the documentation accordingly (JSDoc on the new API; shout if you want README/examples too)
  • I have added an example to the documentation, or no new docs are needed
  • My changes generate no new warnings (npm run check)
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.


- FromJsonSchemaConfig mirrors FunctionToolConfig with schema alias for inputSchema
- Export from main entry with unit test parity vs constructor

Made-with: Cursor
@strands-agent

Copy link
Copy Markdown
Collaborator

This repository has been merged into the strands-agents/harness-sdk monorepo and will be archived shortly. All new development happens there.

If this PR is still relevant, please recreate it against the monorepo. The code now lives under strands-ts/. Full commit history was preserved, so your base should be findable.

Apologies for the disruption, and thank you for contributing!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants