Skip to main content
Glama
nextDriveIoE

GitHub Action Trigger MCP Server

by nextDriveIoE

get_github_release

Retrieve the two most recent releases from any GitHub repository to monitor updates, track version changes, or automate workflows using repository owner and name inputs.

Instructions

Get the latest 2 releases from a GitHub 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 implements the tool logic by fetching the latest 2 releases from the GitHub API, formatting the data, and handling errors.
    async function getGitHubReleases(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 releases from the GitHub API - limit to the latest 2
        const releasesResponse = await axios.get(
          `https://api.github.com/repos/${owner}/${repo}/releases?per_page=2`,
          { headers }
        );
        
        // Format the release information
        const releases = releasesResponse.data.map((release: any) => {
          // Extract asset information
          const assets = release.assets.map((asset: any) => ({
            name: asset.name,
            size: asset.size,
            download_count: asset.download_count,
            browser_download_url: asset.browser_download_url,
            created_at: asset.created_at,
            updated_at: asset.updated_at
          }));
          
          return {
            id: release.id,
            name: release.name || release.tag_name,
            tag_name: release.tag_name,
            published_at: release.published_at,
            draft: release.draft,
            prerelease: release.prerelease,
            html_url: release.html_url,
            body: release.body,
            assets: assets,
            author: {
              login: release.author.login,
              html_url: release.author.html_url
            }
          };
        });
        
        return {
          count: releases.length,
          releases: releases
        };
      } catch (error) {
        if (axios.isAxiosError(error)) {
          // Handle 404 (no releases)
          if (error.response?.status === 404) {
            return {
              count: 0,
              releases: [],
              message: 'No releases found for this repository'
            };
          }
          throw new Error(`GitHub API error: ${error.response?.status} ${error.response?.statusText} - ${error.response?.data?.message || error.message}`);
        }
        throw error;
      }
    }
  • src/index.ts:194-215 (registration)
    Tool registration in the tools array passed to server.setTools(), including name, description, and input schema definition.
    {
      name: "get_github_release",
      description: "Get the latest 2 releases from a GitHub 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"]
      }
    },
  • The dispatch handler case within the main CallToolRequestSchema handler that extracts arguments, calls the getGitHubReleases function, and formats the response.
    case "get_github_release": {
      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 releases = await getGitHubReleases(owner, repo, token);
        
        return {
          content: [{
            type: "text",
            text: JSON.stringify(releases, null, 2)
          }]
        };
      } catch (error) {
        if (error instanceof Error) {
          throw new Error(`Failed to get GitHub releases: ${error.message}`);
        }
        throw error;
      }
    }
  • The input schema definition for the 'get_github_release' tool, specifying parameters and validation.
    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"]
    }
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 what the tool does but lacks critical details like whether it requires authentication (though the token parameter is optional in the schema), rate limits, error handling, or the format of returned data. This leaves significant gaps in understanding the tool's behavior.

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, direct sentence that efficiently conveys the core functionality without unnecessary words. It is front-loaded and appropriately sized for the tool's scope, making it easy to understand at a glance.

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 the complexity of interacting with GitHub APIs, no annotations, and no output schema, the description is incomplete. It fails to address key aspects like authentication needs, rate limiting, error responses, or the structure of the release data returned, which are essential for effective tool usage in a real-world 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?

The input schema has 100% description coverage, clearly documenting all parameters (owner, repo, token). The description does not add any additional meaning or context beyond what the schema provides, such as explaining the 'latest 2 releases' constraint or token usage. Baseline 3 is appropriate as the schema handles parameter documentation adequately.

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 ('latest 2 releases from a GitHub repository'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_github_action' or 'get_github_actions', which focus on GitHub Actions rather than releases, so it misses full sibling distinction.

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, such as when to choose it over other GitHub-related tools or how it fits into broader workflows. There is no mention of prerequisites, exclusions, or contextual usage scenarios.

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