Skip to main content
Glama
onemarc

GitHub Actions MCP Server

by onemarc

trigger_workflow

Trigger a specific GitHub Actions workflow by specifying the repository, workflow ID, and reference. Input parameters can be customized to control workflow execution.

Instructions

Trigger a workflow run

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputsNoInput parameters for the workflow
ownerYesRepository owner
refYesThe reference to run the workflow on (branch, tag, or SHA)
repoYesRepository name
workflowIdYesThe ID of the workflow, filename, or display name as defined in the workflow file's 'name:' field

Implementation Reference

  • The main ToolHandler function implementing the trigger_workflow tool. It resolves the workflow ID by name if it's a string matching a workflow name, lists workflows if necessary, and dispatches the workflow using Octokit's createWorkflowDispatch.
    const handleTriggerWorkflow: ToolHandler = async (args, octokit: Octokit) => {
      const { owner, repo, workflowId, ref, inputs } = args;
      
      try {
        let workflow_id = workflowId;
        
        if (typeof workflowId === 'string' && (workflowId.includes(' ') || /^[A-Z]/.test(workflowId))) {
          const workflows = await octokit.rest.actions.listRepoWorkflows({
            owner,
            repo
          });
          
          // Find the workflow by name
          const matchedWorkflow = workflows.data.workflows.find(w => 
            w.name.toLowerCase() === workflowId.toLowerCase() || 
            w.name === workflowId
          );
          
          if (matchedWorkflow) {
            workflow_id = matchedWorkflow.id;
          } else {
            throw new WorkflowError(`Workflow with name "${workflowId}" not found. Make sure the name matches exactly as defined in the workflow file.`);
          }
        }
        
        const response = await octokit.rest.actions.createWorkflowDispatch({
          owner,
          repo,
          workflow_id,
          ref,
          inputs
        });
    
        return {
          success: true,
          message: "Workflow triggered successfully",
          status: response.status
        };
      } catch (error: any) {
        throw new WorkflowError(`Failed to trigger workflow: ${error.message}`, error.response?.data);
      }
    };
  • The input schema definition for the trigger_workflow tool, specifying parameters like owner, repo, workflowId (string or number, supports name resolution), ref, and optional inputs.
    {
      name: "trigger_workflow",
      description: "Trigger a workflow run",
      inputSchema: {
        type: "object",
        properties: {
          owner: { type: "string", description: "Repository owner" },
          repo: { type: "string", description: "Repository name" },
          workflowId: { 
            oneOf: [
              { type: "string" },
              { type: "number" }
            ],
            description: "The ID of the workflow, filename, or display name as defined in the workflow file's 'name:' field"
          },
          ref: { type: "string", description: "The reference to run the workflow on (branch, tag, or SHA)" },
          inputs: { type: "object", description: "Input parameters for the workflow" }
        },
        required: ["owner", "repo", "workflowId", "ref"]
      }
    },
  • Registration of all tool handlers in the toolHandlers map, including trigger_workflow mapped to its handler function.
    export const toolHandlers: Record<string, ToolHandler> = {
      create_workflow: handleCreateWorkflow,
      list_workflows: handleListWorkflows,
      get_workflow: handleGetWorkflow,
      get_workflow_usage: handleGetWorkflowUsage,
      list_workflow_runs: handleListWorkflowRuns,
      get_workflow_run: handleGetWorkflowRun,
      get_workflow_run_jobs: handleGetWorkflowRunJobs,
      trigger_workflow: handleTriggerWorkflow,
      cancel_workflow_run: handleCancelWorkflowRun,
      rerun_workflow: handleRerunWorkflow,
    };
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only states the action without disclosing behavioral traits such as whether this is a mutation, requires specific permissions, has side effects (e.g., starting a run), rate limits, or expected outcomes. It's minimal and lacks critical context for safe invocation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste, front-loaded and appropriately sized for the tool's purpose. Every word earns its place, making it highly concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a mutation-like tool (triggering implies execution), the description is incomplete. It doesn't cover behavioral aspects, return values, or error handling, leaving significant gaps for an agent to understand the tool's full context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all 5 parameters. The description adds no additional meaning beyond what's in the schema (e.g., no extra context on parameter usage or relationships), meeting the baseline for high coverage without compensation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Trigger a workflow run' clearly states the action (trigger) and resource (workflow run), but it's vague about what 'trigger' entails (e.g., starting execution) and doesn't differentiate from siblings like 'rerun_workflow' or 'create_workflow', which involve similar concepts. It avoids tautology but lacks specificity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'rerun_workflow' or 'create_workflow', nor does it mention prerequisites or context. Usage is implied by the name alone, with no explicit when/when-not statements.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/onemarc/github-actions-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server