Package com.tnsai.mcp.server
Class ToolProvider.ToolResult
java.lang.Object
com.tnsai.mcp.server.ToolProvider.ToolResult
- Enclosing interface:
ToolProvider
Result of a tool execution.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ToolProvider.ToolResultCreates an error result.com.fasterxml.jackson.databind.JsonNodegetError()booleanisError()booleanstatic ToolProvider.ToolResultsuccess(com.fasterxml.jackson.databind.JsonNode content) Creates a successful result with JSON content.static ToolProvider.ToolResultCreates a successful result with text content.
-
Method Details
-
text
Creates a successful result with text content.- Parameters:
text- the result text- Returns:
- a successful ToolResult
-
success
Creates a successful result with JSON content.- Parameters:
content- the result content as JSON array- Returns:
- a successful ToolResult
-
error
Creates an error result.- Parameters:
errorMessage- the error message- Returns:
- an error ToolResult
-
isSuccess
public boolean isSuccess() -
getContent
public com.fasterxml.jackson.databind.JsonNode getContent() -
getError
-
isError
public boolean isError()
-