Package org.mcpjava.server
Interface ContentEncoder<T>
- Type Parameters:
T- the type to encode
public interface ContentEncoder<T>
Encodes an object into MCP content.
Implementations of this interface can be registered to customize how tool results, prompts, and resources are encoded into MCP content.
-
Method Summary
-
Method Details
-
encode
Encode the given object into MCP content.- Parameters:
object- the object to encode- Returns:
- the encoded content
-
getType
Returns the type this encoder handles.- Returns:
- the type this encoder handles
-