change: rename function

This commit is contained in:
lilong.129
2025-05-26 08:49:06 +08:00
parent 778344c826
commit e60c362257
3 changed files with 5 additions and 5 deletions

View File

@@ -1 +1 @@
v5.0.0-beta-2505260043
v5.0.0-beta-2505260849

View File

@@ -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
}

View File

@@ -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)
}