MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / parseWebNavigateInput

Function parseWebNavigateInput

pkg/aiusechat/tools_web.go:23–48  ·  view source on GitHub ↗
(input any)

Source from the content-addressed store, hash-verified

21}
22
23func 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
50func GetWebNavigateToolDefinition(tabId string) uctypes.ToolDefinition {
51

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected