Skip to content

Add tests and implementation for ToolArg.required annotation field for Tools/list #32721

@martindrozdz

Description

@martindrozdz

Required Args
Previously the required list of method parameters assumes that all args are required (this was before ToolArg.required was added with a default value of true).
If ToolArg.required = false then the argument should not be shown in Tools/list.

Given:
That ToolArg.required = false for e.g:
public boolean testToolArgNotRequired(@ToolArg(name = "value", description = "boolean value", required = false) boolean value)
When
We call the Tools/list method to list all of the Tools
Then
Ensure that for the existing tools/list operation there is a test in place that checks that the array called "required" is empty in the JSON response for both primitive and an object types. We can use the existing io.openliberty.mcp.internal.fat.tool.ToolTest.testToolList() method for this.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions