This commit is contained in:
hiifong committed 2025-03-19 00:12:03 +08:00
1 parent c4f619a907
commit bd43811a07
6 files changed
+94 -30

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
package to
import (
"encoding/json"
"github.com/mark3labs/mcp-go/mcp"
)
func TextResult(v any) (*mcp.CallToolResult, error) {
result, err := json.Marshal(v)
if err != nil {
return mcp.NewToolResultError("marshal result error"), err
}
return mcp.NewToolResultText(string(result)), nil
}