mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-09-19 09:40:12 +00:00
15 lines
236 B
Go
15 lines
236 B
Go
package controller
|
|
|
|
import "encoding/json"
|
|
|
|
func marshalMCPToolResult(result any) (string, error) {
|
|
if result == nil {
|
|
return "{}", nil
|
|
}
|
|
b, err := json.Marshal(result)
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
return string(b), nil
|
|
}
|