Class McpTool<I>
java.lang.Object
net.mcreator.io.mcp.tool.McpTool<I>
- Type Parameters:
I- input type used for JSON Schema generation and argument deserialization
- All Implemented Interfaces:
IMcpTool
- Direct Known Subclasses:
MCreatorMcpTool
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract CompletableFuture<ToolResult> Handles a tool invocation with deserialized, typed arguments.protected static CompletableFuture<ToolResult> completed(ToolResult result) protected static CompletableFuture<ToolResult> completedError(String message) protected static CompletableFuture<ToolResult> completedError(String message, Throwable cause) protected static CompletableFuture<ToolResult> completedObject(Object structured) protected static CompletableFuture<ToolResult> completedText(String text) Class<?> invoke(com.google.gson.JsonObject arguments) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IMcpTool
getDescription, getName
-
Constructor Details
-
McpTool
-
McpTool
-
-
Method Details
-
getInputType
- Specified by:
getInputTypein interfaceIMcpTool
-
getOutputType
- Specified by:
getOutputTypein interfaceIMcpTool
-
getAnnotations
- Specified by:
getAnnotationsin interfaceIMcpTool
-
invoke
public final CompletableFuture<McpSchema.CallToolResponse> invoke(com.google.gson.JsonObject arguments) -
call
Handles a tool invocation with deserialized, typed arguments. -
completed
-
completedText
-
completedError
-
completedError
-
completedObject
-