@@ -43,7 +43,7 @@ func (e *Engine) runOpenAPIRevamp(tool types.Tool, input string) (*Return, error
4343 return nil , fmt .Errorf ("failed to load OpenAPI file %s: %w" , source , err )
4444 }
4545
46- opList , err := openapi .List (t , filter )
46+ opList , err := openapi .List (t , filter , "getSchema" + strings . TrimPrefix ( tool . Name , "listOperations" ) )
4747 if err != nil {
4848 return nil , fmt .Errorf ("failed to list operations: %w" , err )
4949 }
@@ -66,7 +66,7 @@ func (e *Engine) runOpenAPIRevamp(tool types.Tool, input string) (*Return, error
6666 } else if ! match {
6767 // Report to the LLM that the operation was not found
6868 return & Return {
69- Result : ptr (fmt .Sprintf ("operation %s not found" , operation )),
69+ Result : ptr (fmt .Sprintf ("ERROR: operation %s not found" , operation )),
7070 }, nil
7171 }
7272 }
@@ -85,14 +85,14 @@ func (e *Engine) runOpenAPIRevamp(tool types.Tool, input string) (*Return, error
8585 defaultHost = u .Scheme + "://" + u .Hostname ()
8686 }
8787
88- schema , _ , found , err := openapi .GetSchema (operation , defaultHost , t )
88+ schema , _ , found , err := openapi .GetSchema (operation , defaultHost , "runOperation" + strings . TrimPrefix ( tool . Name , "getSchema" ), t )
8989 if err != nil {
9090 return nil , fmt .Errorf ("failed to get schema: %w" , err )
9191 }
9292 if ! found {
9393 // Report to the LLM that the operation was not found
9494 return & Return {
95- Result : ptr (fmt .Sprintf ("operation %s not found" , operation )),
95+ Result : ptr (fmt .Sprintf ("ERROR: operation %s not found" , operation )),
9696 }, nil
9797 }
9898
@@ -115,7 +115,7 @@ func (e *Engine) runOpenAPIRevamp(tool types.Tool, input string) (*Return, error
115115 } else if ! match {
116116 // Report to the LLM that the operation was not found
117117 return & Return {
118- Result : ptr (fmt .Sprintf ("operation %s not found" , operation )),
118+ Result : ptr (fmt .Sprintf ("ERROR: operation %s not found" , operation )),
119119 }, nil
120120 }
121121 }
@@ -134,13 +134,13 @@ func (e *Engine) runOpenAPIRevamp(tool types.Tool, input string) (*Return, error
134134 defaultHost = u .Scheme + "://" + u .Hostname ()
135135 }
136136
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 )
138138 if err != nil {
139139 return nil , fmt .Errorf ("failed to run operation %s: %w" , operation , err )
140140 } else if ! found {
141141 // Report to the LLM that the operation was not found
142142 return & Return {
143- Result : ptr (fmt .Sprintf ("operation %s not found" , operation )),
143+ Result : ptr (fmt .Sprintf ("ERROR: operation %s not found" , operation )),
144144 }, nil
145145 }
146146
0 commit comments