Skip to main content
Glama
nextDriveIoE

GitHub Action Trigger MCP Server

by nextDriveIoE

get_github_actions

Retrieve available GitHub Actions workflows from a repository to understand automation options and trigger points.

Instructions

Get available GitHub Actions for a repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesOwner of the repository (username or organization)
repoYesName of the repository
tokenNoGitHub personal access token (optional)

Implementation Reference

  • The core handler function that fetches GitHub Actions workflows from the specified repository using the GitHub API, including workflow details and file contents.
    async function getGitHubActions(owner: string, repo: string, 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}`;
        }
    
        // Fetch workflows from the GitHub API
        const workflowsResponse = await axios.get(
          `https://api.github.com/repos/${owner}/${repo}/actions/workflows`,
          { headers }
        );
    
        // Extract workflow information
        const workflows = workflowsResponse.data.workflows.map((workflow: any) => ({
          id: workflow.id,
          name: workflow.name,
          path: workflow.path,
          state: workflow.state,
          url: workflow.html_url
        }));
    
        // For each workflow, get the associated jobs
        const workflowDetails = await Promise.all(
          workflows.map(async (workflow: any) => {
            try {
              // Get the raw workflow file content
              const contentResponse = await axios.get(
                `https://api.github.com/repos/${owner}/${repo}/contents/${workflow.path}`,
                { headers }
              );
    
              const content = Buffer.from(contentResponse.data.content, 'base64').toString('utf-8');
    
              return {
                ...workflow,
                content
              };
            } catch (error) {
              // If we can't get the content, just return the workflow without it
              return workflow;
            }
          })
        );
    
        return workflowDetails;
      } 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;
      }
    }
  • The input schema definition for the get_github_actions tool, including parameters owner, repo, and optional token.
    {
      name: "get_github_actions",
      description: "Get available GitHub Actions for a repository",
      inputSchema: {
        type: "object",
        properties: {
          owner: {
            type: "string",
            description: "Owner of the repository (username or organization)"
          },
          repo: {
            type: "string",
            description: "Name of the repository"
          },
          token: {
            type: "string",
            description: "GitHub personal access token (optional)"
          }
        },
        required: ["owner", "repo"]
      }
    },
  • src/index.ts:728-752 (registration)
    The registration and dispatch logic in the CallToolRequestSchema handler that processes calls to get_github_actions and invokes the core handler function.
    case "get_github_actions": {
    const owner = String(request.params.arguments?.owner);
    const repo = String(request.params.arguments?.repo);
    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 actions = await getGitHubActions(owner, repo, token);
    
    return {
    content: [{
    type: "text",
    text: JSON.stringify(actions, null, 2)
    }]
    };
    } catch (error) {
    if (error instanceof Error) {
    throw new Error(`Failed to get GitHub Actions: ${error.message}`);
    }
    throw error;
    }
    }
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 offers minimal behavioral insight. It doesn't disclose whether this is a read-only operation, what authentication is required (though 'token' is optional in schema), rate limits, pagination, or what 'available' means (e.g., active vs. all actions). This leaves significant gaps 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, clear sentence with zero wasted words. It's front-loaded with the core purpose and appropriately sized for a straightforward tool, making it easy to parse quickly.

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 tool with no annotations and no output schema, the description is insufficient. It doesn't explain what 'available GitHub Actions' entails (e.g., list format, metadata included), authentication needs despite an optional token, or error handling. Given the complexity of GitHub APIs and sibling tools, more context is needed for reliable 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 parameters are well-documented in the schema itself. The description adds no additional meaning beyond implying the tool fetches actions for a repository, which aligns with the schema but doesn't enhance parameter understanding. Baseline 3 is appropriate given high schema 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 ('Get') and resource ('GitHub Actions for a repository'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'get_github_action' (singular) or 'get_github_release', leaving some ambiguity about scope.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, constraints, or relationships with sibling tools like 'get_github_action' (singular) or 'trigger_github_action', leaving the agent to infer usage context.

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