(input any)
| 21 | } |
| 22 | |
| 23 | func parseWebNavigateInput(input any) (*WebNavigateToolInput, error) { |
| 24 | result := &WebNavigateToolInput{} |
| 25 | |
| 26 | if input == nil { |
| 27 | return nil, fmt.Errorf("input is required") |
| 28 | } |
| 29 | |
| 30 | inputBytes, err := json.Marshal(input) |
| 31 | if err != nil { |
| 32 | return nil, fmt.Errorf("failed to marshal input: %w", err) |
| 33 | } |
| 34 | |
| 35 | if err := json.Unmarshal(inputBytes, result); err != nil { |
| 36 | return nil, fmt.Errorf("failed to unmarshal input: %w", err) |
| 37 | } |
| 38 | |
| 39 | if result.WidgetId == "" { |
| 40 | return nil, fmt.Errorf("widget_id is required") |
| 41 | } |
| 42 | |
| 43 | if result.Url == "" { |
| 44 | return nil, fmt.Errorf("url is required") |
| 45 | } |
| 46 | |
| 47 | return result, nil |
| 48 | } |
| 49 | |
| 50 | func GetWebNavigateToolDefinition(tabId string) uctypes.ToolDefinition { |
| 51 |
no outgoing calls
no test coverage detected