Skip to main content
Glama
nextDriveIoE

GitHub Action Trigger MCP Server

by nextDriveIoE

get_github_action

Retrieve detailed GitHub Action specifications including required inputs, parameters, and configuration details for workflow integration.

Instructions

Get detailed information about a specific GitHub Action, including inputs and their requirements

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesOwner of the action (username or organization)
repoYesRepository name of the action
pathNoPath to the action.yml or action.yaml file (usually just 'action.yml')
refNoGit reference (branch, tag, or commit SHA, default: main)
tokenNoGitHub personal access token (optional)

Implementation Reference

  • The core handler function that fetches the specified action.yml file from a GitHub repository using the GitHub API, decodes and parses the YAML content using js-yaml, extracts and formats the inputs and other metadata, and returns a structured representation of the GitHub Action.
    async function getGitHubAction(owner: string, repo: string, path: string = 'action.yml', ref: string = 'main', token?: string) {
      // Use provided token or fall back to config token
      const authToken = token || config.githubToken;
      
      try {
        const headers: Record<string, string> = {
          'Accept': 'application/vnd.github+json',
          'X-GitHub-Api-Version': '2022-11-28'
        };
        
        if (authToken) {
          headers['Authorization'] = `Bearer ${authToken}`;
        }
        
        // First, try to get the action.yml file content
        const contentResponse = await axios.get(
          `https://api.github.com/repos/${owner}/${repo}/contents/${path}?ref=${ref}`,
          { headers }
        );
        
        if (!contentResponse.data.content) {
          throw new Error(`Could not find ${path} file in ${owner}/${repo}`);
        }
        
        // Decode the base64 content
        const content = Buffer.from(contentResponse.data.content, 'base64').toString('utf-8');
        
        // Parse the YAML content
        const yaml = require('js-yaml');
        const actionDefinition = yaml.load(content);
        
        // Extract and format the inputs information
        const inputs = actionDefinition.inputs || {};
        const formattedInputs = Object.entries(inputs).map(([name, config]: [string, any]) => ({
          name,
          description: config.description || '',
          default: config.default,
          required: config.required === true,
          deprecationMessage: config.deprecationMessage,
        }));
        
        return {
          name: actionDefinition.name || '',
          description: actionDefinition.description || '',
          author: actionDefinition.author || '',
          inputs: formattedInputs,
          runs: actionDefinition.runs,
          branding: actionDefinition.branding,
          // Include original content for reference
          originalYaml: content
        };
      } catch (error) {
        if (axios.isAxiosError(error)) {
          throw new Error(`GitHub API error: ${error.response?.status} ${error.response?.statusText} - ${error.response?.data?.message || error.message}`);
        }
        throw error;
      }
    }
  • src/index.ts:131-159 (registration)
    Registers the 'get_github_action' tool in the MCP server's listTools response, including its name, description, and input schema definition.
      name: "get_github_action",
      description: "Get detailed information about a specific GitHub Action, including inputs and their requirements",
      inputSchema: {
        type: "object",
        properties: {
          owner: {
            type: "string",
            description: "Owner of the action (username or organization)"
          },
          repo: {
            type: "string",
            description: "Repository name of the action"
          },
          path: {
            type: "string",
            description: "Path to the action.yml or action.yaml file (usually just 'action.yml')"
          },
          ref: {
            type: "string",
            description: "Git reference (branch, tag, or commit SHA, default: main)"
          },
          token: {
            type: "string",
            description: "GitHub personal access token (optional)"
          }
        },
        required: ["owner", "repo"]
      }
    },
  • Defines the input schema for the 'get_github_action' tool, specifying properties like owner, repo, path, ref, token, with owner and repo required.
    inputSchema: {
      type: "object",
      properties: {
        owner: {
          type: "string",
          description: "Owner of the action (username or organization)"
        },
        repo: {
          type: "string",
          description: "Repository name of the action"
        },
        path: {
          type: "string",
          description: "Path to the action.yml or action.yaml file (usually just 'action.yml')"
        },
        ref: {
          type: "string",
          description: "Git reference (branch, tag, or commit SHA, default: main)"
        },
        token: {
          type: "string",
          description: "GitHub personal access token (optional)"
        }
      },
      required: ["owner", "repo"]
    }
  • The MCP CallToolRequestHandler case that handles incoming calls to 'get_github_action', extracts arguments, validates inputs, calls the getGitHubAction function, and returns the result as MCP content.
    case "get_github_action": {
      const owner = String(request.params.arguments?.owner);
      const repo = String(request.params.arguments?.repo);
      const path = request.params.arguments?.path ? String(request.params.arguments?.path) : 'action.yml';
      const ref = request.params.arguments?.ref ? String(request.params.arguments?.ref) : 'main';
      const token = request.params.arguments?.token ? String(request.params.arguments?.token) : undefined;
      
      if (!owner || !repo) {
        throw new Error("Owner and repo are required");
      }
    
      try {
        const actionDetails = await getGitHubAction(owner, repo, path, ref, token);
        
        return {
          content: [{
            type: "text",
            text: JSON.stringify(actionDetails, null, 2)
          }]
        };
      } catch (error) {
        if (error instanceof Error) {
          throw new Error(`Failed to get GitHub Action details: ${error.message}`);
        }
        throw error;
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It describes what information is returned but lacks details on permissions required (e.g., public vs. private repos), rate limits, error conditions, or response format. For a tool with no annotations, this leaves significant behavioral gaps.

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 that directly states the tool's purpose without unnecessary words. It's front-loaded with the core functionality and includes a useful detail about inputs and requirements. Every part of the sentence earns its place.

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

Completeness3/5

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

Given no annotations and no output schema, the description is minimally adequate for a read-only tool. It clarifies the scope (detailed info about a specific action) but doesn't address behavioral aspects like authentication needs or response structure. For a tool with 5 parameters and no structured safety hints, it should provide more context about usage constraints.

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 5 parameters thoroughly. The description adds no parameter-specific information beyond what's in the schema (e.g., it doesn't clarify 'path' defaults or 'token' usage scenarios). Baseline 3 is appropriate when schema does the heavy lifting.

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 tool's purpose: 'Get detailed information about a specific GitHub Action, including inputs and their requirements.' It specifies the verb ('Get') and resource ('GitHub Action') with additional detail about what information is retrieved. However, it doesn't explicitly differentiate from sibling tools like 'get_github_actions' (plural vs. singular).

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 sibling tools like 'get_github_actions' (which likely lists multiple actions) or 'trigger_github_action' (which executes an action). There's no context about prerequisites, limitations, or typical use cases.

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/nextDriveIoE/github-action-trigger-mcp'

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