Add rag utility

This commit is contained in:
shahondin1624
2026-02-14 17:59:18 +01:00
parent 3030088124
commit a717b21d26
2 changed files with 15 additions and 3 deletions

View File

@@ -66,6 +66,17 @@ public abstract class McpValidatedTool implements McpTool {
return new CallToolResultBuilder().addText(text).build();
}
protected McpSchema.CallToolResult success(String text, Map<String, Object> structured) {
return new CallToolResultBuilder()
.addText(text)
.structuredContent(structured)
.build();
}
protected McpSchema.CallToolResult successResult(Object resultValue) {
return success(String.valueOf(resultValue), Map.of("result", resultValue));
}
protected McpSchema.CallToolResult error(String text) {
return new CallToolResultBuilder().isError(true).addText(text).build();
}