spring-projects / spring-projects/spring-ai
Tool json schema does not work for parameters
Open
Nobody has claimed this yet.
status: waiting-for-triage
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 2.9k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 6
Description
When we define a tool method, e.g.
public String getBuilds(
@ToolParam(description = "test")
@ArraySchema(maxItems = 50, minItems = 1)
List<String> buildIds,
ToolContext toolContext) {
The description is been added to the json schema, however, other annotations supported by the json schema generator are not been honored and the generated schema does not include the maxItems/minItems
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the tool method example with @ToolParam and @ArraySchema, then trace the tool JSON schema generation path for method parameters. Compare the generated schema with the annotations and verify that maxItems and minItems appear alongside the parameter description.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100