mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-07 06:22:43 +08:00
change: rename function
This commit is contained in:
@@ -1 +1 @@
|
||||
v5.0.0-beta-2505260043
|
||||
v5.0.0-beta-2505260849
|
||||
|
||||
@@ -80,8 +80,8 @@ func (s *MCPServer4XTDriver) GetTool(name string) *mcp.Tool {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetToolByActionMethod returns the tool that handles the given action method
|
||||
func (s *MCPServer4XTDriver) GetToolByActionMethod(actionMethod option.ActionMethod) ActionTool {
|
||||
// GetToolByAction returns the tool that handles the given action method
|
||||
func (s *MCPServer4XTDriver) GetToolByAction(actionMethod option.ActionMethod) ActionTool {
|
||||
if s.actionToolMap == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ func (c *MCPClient4XTDriver) ListTools(ctx context.Context, req mcp.ListToolsReq
|
||||
}
|
||||
|
||||
func (c *MCPClient4XTDriver) CallTool(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error) {
|
||||
actionTool := c.Server.GetToolByActionMethod(option.ActionMethod(req.Params.Name))
|
||||
actionTool := c.Server.GetToolByAction(option.ActionMethod(req.Params.Name))
|
||||
if actionTool == nil {
|
||||
return mcp.NewToolResultError(fmt.Sprintf("action %s for tool not found", req.Params.Name)), nil
|
||||
}
|
||||
@@ -81,7 +81,7 @@ func (c *MCPClient4XTDriver) Close() error {
|
||||
|
||||
func (dExt *XTDriver) ExecuteAction(action MobileAction) (err error) {
|
||||
// Find the corresponding tool for this action method
|
||||
tool := dExt.Client.Server.GetToolByActionMethod(action.Method)
|
||||
tool := dExt.Client.Server.GetToolByAction(action.Method)
|
||||
if tool == nil {
|
||||
return fmt.Errorf("no tool found for action method: %s", action.Method)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user