ActionsList returns the tool and handler for listing GitHub Actions resources.
(t translations.TranslationHelperFunc)
| 199 | |
| 200 | // ActionsList returns the tool and handler for listing GitHub Actions resources. |
| 201 | func ActionsList(t translations.TranslationHelperFunc) inventory.ServerTool { |
| 202 | tool := NewTool( |
| 203 | ToolsetMetadataActions, |
| 204 | mcp.Tool{ |
| 205 | Name: "actions_list", |
| 206 | Description: t("TOOL_ACTIONS_LIST_DESCRIPTION", |
| 207 | `Tools for listing GitHub Actions resources. |
| 208 | Use this tool to list workflows in a repository, or list workflow runs, jobs, and artifacts for a specific workflow or workflow run. |
| 209 | `), |
| 210 | Annotations: &mcp.ToolAnnotations{ |
| 211 | Title: t("TOOL_ACTIONS_LIST_USER_TITLE", "List GitHub Actions workflows in a repository"), |
| 212 | ReadOnlyHint: true, |
| 213 | }, |
| 214 | InputSchema: &jsonschema.Schema{ |
| 215 | Type: "object", |
| 216 | Properties: map[string]*jsonschema.Schema{ |
| 217 | "method": { |
| 218 | Type: "string", |
| 219 | Description: "The action to perform", |
| 220 | Enum: []any{ |
| 221 | actionsMethodListWorkflows, |
| 222 | actionsMethodListWorkflowRuns, |
| 223 | actionsMethodListWorkflowJobs, |
| 224 | actionsMethodListWorkflowArtifacts, |
| 225 | }, |
| 226 | }, |
| 227 | "owner": { |
| 228 | Type: "string", |
| 229 | Description: "Repository owner", |
| 230 | }, |
| 231 | "repo": { |
| 232 | Type: "string", |
| 233 | Description: "Repository name", |
| 234 | }, |
| 235 | "resource_id": { |
| 236 | Type: "string", |
| 237 | Description: `The unique identifier of the resource. This will vary based on the "method" provided, so ensure you provide the correct ID: |
| 238 | - Do not provide any resource ID for 'list_workflows' method. |
| 239 | - Provide a workflow ID or workflow file name (e.g. ci.yaml) for 'list_workflow_runs' method, or omit to list all workflow runs in the repository. |
| 240 | - Provide a workflow run ID for 'list_workflow_jobs' and 'list_workflow_run_artifacts' methods. |
| 241 | `, |
| 242 | }, |
| 243 | "workflow_runs_filter": { |
| 244 | Type: "object", |
| 245 | Description: "Filters for workflow runs. **ONLY** used when method is 'list_workflow_runs'", |
| 246 | Properties: map[string]*jsonschema.Schema{ |
| 247 | "actor": { |
| 248 | Type: "string", |
| 249 | Description: "Filter to a specific GitHub user's workflow runs.", |
| 250 | }, |
| 251 | "branch": { |
| 252 | Type: "string", |
| 253 | Description: "Filter workflow runs to a specific Git branch. Use the name of the branch.", |
| 254 | }, |
| 255 | "event": { |
| 256 | Type: "string", |
| 257 | Description: "Filter workflow runs to a specific event type", |
| 258 | Enum: []any{ |