Skip to main content
Glama
piyushgIITian

GitHub Enterprise MCP Server

trigger-workflow

Initiate a workflow run in a GitHub repository using specified branch, tag, or commit reference to automate CI/CD processes and deployment tasks.

Instructions

Trigger a workflow run in a GitHub repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputsNoWorkflow inputs
ownerYesRepository owner
refYesGit reference (branch, tag, SHA)
repoYesRepository name
workflow_idYesWorkflow ID or file name

Implementation Reference

  • The core handler function that parses arguments using TriggerWorkflowSchema, authenticates with GitHub API, and dispatches the workflow run using actions.createWorkflowDispatch.
    export async function triggerWorkflow(args: unknown): Promise<any> {
      const { owner, repo, workflow_id, ref, inputs } = TriggerWorkflowSchema.parse(args);
      const github = getGitHubApi();
    
      return tryCatchAsync(async () => {
        const { data } = await github.getOctokit().actions.createWorkflowDispatch({
          owner,
          repo,
          workflow_id,
          ref,
          inputs,
        });
    
        return {
          success: true,
          message: `Workflow dispatch event created for workflow ${workflow_id} on ref ${ref}`,
          data,
        };
      }, 'Failed to trigger workflow');
    }
  • Zod schema for validating trigger-workflow inputs, extending OwnerRepoSchema (owner/repo required). Used in the handler for parsing.
    export const TriggerWorkflowSchema = OwnerRepoSchema.extend({
      workflow_id: z.union([z.string(), z.number()]),
      ref: z.string().min(1, 'Git reference is required'),
      inputs: z.record(z.string()).optional(),
    });
  • src/server.ts:356-386 (registration)
    Tool registration in the ListToolsRequestSchema handler, defining name, description, and inputSchema for the MCP protocol.
    {
      name: 'trigger-workflow',
      description: 'Trigger a workflow run in a GitHub repository',
      inputSchema: {
        type: 'object',
        properties: {
          owner: {
            type: 'string',
            description: 'Repository owner',
          },
          repo: {
            type: 'string',
            description: 'Repository name',
          },
          workflow_id: {
            type: ['string', 'number'],
            description: 'Workflow ID or file name',
          },
          ref: {
            type: 'string',
            description: 'Git reference (branch, tag, SHA)',
          },
          inputs: {
            type: 'object',
            description: 'Workflow inputs',
          },
        },
        required: ['owner', 'repo', 'workflow_id', 'ref'],
        additionalProperties: false,
      },
    },
  • Dispatch in the CallToolRequestSchema switch statement that routes calls to the triggerWorkflow handler.
    case 'trigger-workflow':
      result = await triggerWorkflow(parsedArgs);
      break;
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('trigger') but doesn't explain what happens after triggering (e.g., runs asynchronously, may fail, requires permissions, rate limits, or what the response looks like). This leaves significant gaps for a mutation tool.

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, clear sentence with no wasted words. It's front-loaded with the core action and resource, making it highly efficient and easy to parse.

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?

For a mutation tool with no annotations and no output schema, the description is insufficient. It doesn't cover behavioral aspects like error handling, permissions, or response format, leaving the agent with incomplete context for safe and effective use.

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 already documents all parameters thoroughly. The description adds no additional parameter information beyond what's in the schema, maintaining the baseline score of 3 for adequate but not enhanced coverage.

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

Purpose4/5

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

The description clearly states the action ('trigger') and resource ('workflow run in a GitHub repository'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'list-workflow-runs' or 'list-workflows', which are related but distinct operations.

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. It doesn't mention prerequisites (e.g., needing repository access), when not to use it, or how it differs from similar tools like manually starting workflows in the UI or using other automation methods.

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

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/piyushgIITian/github-enterprice-mcp'

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