@@ -43,7 +43,7 @@ func (e *Engine) runOpenAPIRevamp(tool types.Tool, input string) (*Return, error
43
43
return nil , fmt .Errorf ("failed to load OpenAPI file %s: %w" , source , err )
44
44
}
45
45
46
- opList , err := openapi .List (t , filter )
46
+ opList , err := openapi .List (t , filter , "getSchema" + strings . TrimPrefix ( tool . Name , "listOperations" ) )
47
47
if err != nil {
48
48
return nil , fmt .Errorf ("failed to list operations: %w" , err )
49
49
}
@@ -66,7 +66,7 @@ func (e *Engine) runOpenAPIRevamp(tool types.Tool, input string) (*Return, error
66
66
} else if ! match {
67
67
// Report to the LLM that the operation was not found
68
68
return & Return {
69
- Result : ptr (fmt .Sprintf ("operation %s not found" , operation )),
69
+ Result : ptr (fmt .Sprintf ("ERROR: operation %s not found" , operation )),
70
70
}, nil
71
71
}
72
72
}
@@ -85,14 +85,14 @@ func (e *Engine) runOpenAPIRevamp(tool types.Tool, input string) (*Return, error
85
85
defaultHost = u .Scheme + "://" + u .Hostname ()
86
86
}
87
87
88
- schema , _ , found , err := openapi .GetSchema (operation , defaultHost , t )
88
+ schema , _ , found , err := openapi .GetSchema (operation , defaultHost , "runOperation" + strings . TrimPrefix ( tool . Name , "getSchema" ), t )
89
89
if err != nil {
90
90
return nil , fmt .Errorf ("failed to get schema: %w" , err )
91
91
}
92
92
if ! found {
93
93
// Report to the LLM that the operation was not found
94
94
return & Return {
95
- Result : ptr (fmt .Sprintf ("operation %s not found" , operation )),
95
+ Result : ptr (fmt .Sprintf ("ERROR: operation %s not found" , operation )),
96
96
}, nil
97
97
}
98
98
@@ -115,7 +115,7 @@ func (e *Engine) runOpenAPIRevamp(tool types.Tool, input string) (*Return, error
115
115
} else if ! match {
116
116
// Report to the LLM that the operation was not found
117
117
return & Return {
118
- Result : ptr (fmt .Sprintf ("operation %s not found" , operation )),
118
+ Result : ptr (fmt .Sprintf ("ERROR: operation %s not found" , operation )),
119
119
}, nil
120
120
}
121
121
}
@@ -134,13 +134,13 @@ func (e *Engine) runOpenAPIRevamp(tool types.Tool, input string) (*Return, error
134
134
defaultHost = u .Scheme + "://" + u .Hostname ()
135
135
}
136
136
137
- result , found , err := openapi .Run (operation , defaultHost , args , t , e .Env )
137
+ result , found , err := openapi .Run (operation , defaultHost , args , tool . Name , t , e .Env )
138
138
if err != nil {
139
139
return nil , fmt .Errorf ("failed to run operation %s: %w" , operation , err )
140
140
} else if ! found {
141
141
// Report to the LLM that the operation was not found
142
142
return & Return {
143
- Result : ptr (fmt .Sprintf ("operation %s not found" , operation )),
143
+ Result : ptr (fmt .Sprintf ("ERROR: operation %s not found" , operation )),
144
144
}, nil
145
145
}
146
146
0 commit comments