7373
7474 // RequestParams contains the tool name and arguments
7575 RequestParams struct {
76- Name string `json:"name"`
77- Arguments map [string ]interface {} `json:"arguments"`
76+ Name string `json:"name"`
77+ Arguments map [string ]any `json:"arguments"`
7878 }
7979
8080 // Content matches the response format of a text content response
@@ -308,8 +308,8 @@ func addCommandFromTool(toolsCmd *cobra.Command, tool *Tool, prettyPrint bool) {
308308}
309309
310310// buildArgumentsMap extracts flag values into a map of arguments
311- func buildArgumentsMap (cmd * cobra.Command , tool * Tool ) (map [string ]interface {} , error ) {
312- arguments := make (map [string ]interface {} )
311+ func buildArgumentsMap (cmd * cobra.Command , tool * Tool ) (map [string ]any , error ) {
312+ arguments := make (map [string ]any )
313313
314314 for name , prop := range tool .InputSchema .Properties {
315315 switch prop .Type {
@@ -340,7 +340,7 @@ func buildArgumentsMap(cmd *cobra.Command, tool *Tool) (map[string]interface{},
340340 }
341341 case "object" :
342342 if jsonStr , _ := cmd .Flags ().GetString (name + "-json" ); jsonStr != "" {
343- var jsonArray []interface {}
343+ var jsonArray []any
344344 if err := json .Unmarshal ([]byte (jsonStr ), & jsonArray ); err != nil {
345345 return nil , fmt .Errorf ("error parsing JSON for %s: %w" , name , err )
346346 }
@@ -355,7 +355,7 @@ func buildArgumentsMap(cmd *cobra.Command, tool *Tool) (map[string]interface{},
355355}
356356
357357// buildJSONRPCRequest creates a JSON-RPC request with the given tool name and arguments
358- func buildJSONRPCRequest (method , toolName string , arguments map [string ]interface {} ) (string , error ) {
358+ func buildJSONRPCRequest (method , toolName string , arguments map [string ]any ) (string , error ) {
359359 id , err := rand .Int (rand .Reader , big .NewInt (10000 ))
360360 if err != nil {
361361 return "" , fmt .Errorf ("failed to generate random ID: %w" , err )
@@ -432,7 +432,7 @@ func printResponse(response string, prettyPrint bool) error {
432432 // Extract text from content items of type "text"
433433 for _ , content := range resp .Result .Content {
434434 if content .Type == "text" {
435- var textContentObj map [string ]interface {}
435+ var textContentObj map [string ]any
436436 err := json .Unmarshal ([]byte (content .Text ), & textContentObj )
437437
438438 if err == nil {
@@ -445,7 +445,7 @@ func printResponse(response string, prettyPrint bool) error {
445445 }
446446
447447 // Fallback parsing as JSONL
448- var textContentList []map [string ]interface {}
448+ var textContentList []map [string ]any
449449 if err := json .Unmarshal ([]byte (content .Text ), & textContentList ); err != nil {
450450 return fmt .Errorf ("failed to parse text content as a list: %w" , err )
451451 }
0 commit comments