Conversation
The filters don't return something new, they filter existing results.
…ub-mcp-server into actions-consolidated
|
Link to Eval comparison for pre and post- consolidated Actions toolset: https://github.com/github/copilot-agent-services/issues/939#issuecomment-3553838746 |
| switch resourceType { | ||
| case actionsActionTypeListWorkflows: | ||
| // Do nothing, no resource ID needed | ||
| default: | ||
| if resourceID == "" { | ||
| return mcp.NewToolResultError(fmt.Sprintf("missing required parameter for action %s: resource_id", actionTypeStr)), nil | ||
| } | ||
|
|
||
| workflowRuns, resp, err := client.Actions.ListWorkflowRunsByFileName(ctx, owner, repo, workflowID, opts) | ||
| if err != nil { | ||
| return nil, fmt.Errorf("failed to list workflow runs: %w", err) | ||
| // For other actions, resource ID must be an integer | ||
| resourceIDInt, parseErr = strconv.ParseInt(resourceID, 10, 64) | ||
| if parseErr != nil { | ||
| return mcp.NewToolResultError(fmt.Sprintf("invalid resource_id, must be an integer for action %s: %v", actionTypeStr, parseErr)), nil | ||
| } | ||
| } |
There was a problem hiding this comment.
There's a potential bug in the validation logic. The code at line 232 attempts to parse resource_id as an integer for all actions except list_workflows. However, line 242 shows that listWorkflowRuns receives the string resourceID (not the parsed resourceIDInt), which means workflow runs can be queried by either a workflow ID (integer) OR a workflow filename (string like "ci.yaml"). The validation at line 232 will incorrectly fail when a user provides a workflow filename for the list_workflow_runs action. The actionsActionTypeListWorkflowRuns case should be excluded from the integer parsing requirement, similar to how actionsActionTypeListWorkflows is excluded.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Closing as completed by @mattdholloway |
Consolidate various Actions tooling into a single tool with a new
actionargument:The following tools are consolidated into a multiple consolidated tools
actions_listlist_workflowslist_workflow_jobslist_workflow_runslist_workflow_run_artifactsactions_gettool:get_workflowget_workflow_runget_workflow_jobdownload_workflow_run_artifactget_workflow_run_usageget_workflow_run_logsget_workflow_job_logsactions_run_triggertool:run_workflowrerun_workflow_runrerun_failed_jobscancel_workflow_rundelete_workflow_run_logs