Update
This commit is contained in:
6 files changed
+94
-30
No files matched your search
@@ -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
|
||||
}
|
||||
Reference in new issue
Block a user