// A tools bundle in Go: one tool of its own and one seat verb, served over stdio. package main import ( "fmt" "os" stdio "git.novox.be/novox/mesh-sdk/go" ) func main() { err := stdio.Serve("go-example", []stdio.Tool{ {Name: "greet", Description: "say hello", Input: map[string]any{"who": map[string]any{"type": "string", "description": "whom"}}, Run: func(a map[string]any) (any, error) { who, _ := a["who"].(string) if who == "" { who = "world" } return map[string]any{"greeting": "hello " + who, "language": "go"}, nil }}, {Name: "node-lamp.on", Description: "the seat's verb", Run: func(map[string]any) (any, error) { return map[string]any{"on": true, "language": "go"}, nil }}, }) if err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) } }