Skip to content

Commit dfa0194

Browse files
authored
Merge branch 'main' into wb/mcp-json-args
2 parents 8b0bec1 + 5d1e211 commit dfa0194

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

cmd/src/mcp.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,20 @@ func mcpMain(args []string) error {
115115
}
116116

117117
func printSchemas(tool *mcp.ToolDef) error {
118-
input, err := json.Marshal(tool.InputSchema)
119-
if err != nil {
120-
return err
118+
var schema = struct {
119+
Name string `json:"tool"`
120+
Input any `json:"inputSchema"`
121+
Output any `json:"outputSchema"`
122+
}{
123+
Name: tool.Name,
124+
Input: tool.InputSchema,
125+
Output: tool.OutputSchema,
121126
}
122-
output, err := json.Marshal(tool.OutputSchema)
127+
jsonVal, err := json.Marshal(schema)
123128
if err != nil {
124129
return err
125130
}
126-
127-
fmt.Printf("Input:\n%v\nOutput:\n%v\n", string(input), string(output))
131+
fmt.Println(string(jsonVal))
128132
return nil
129133
}
130134

0 commit comments

Comments
 (0)