Package io.openliberty.mcp.tools
Interface ToolResponseEncoder<TYPE>
- Type Parameters:
TYPE-
public interface ToolResponseEncoder<TYPE>
Encodes an object as
ToolResponse.
If a tool response encoder exists and matches a specific return type then it always takes precedence over matching
ContentEncoder.
Implementation classes must be CDI beans. Qualifiers are ignored. Dependent beans are
reused during encoding.
Encoders may define the priority with Priority. An encoder with higher priority takes precedence.
- See Also:
-
ToolResponseTool
-
Method Summary
-
Method Details
-
getType
Returns the type handled by this encoder.- Returns:
- the class of objects this encoder can encode, must not be
null
-
encode
Encodes the given business object into the target type- Parameters:
value-- Returns:
- the encoded value
-