Skip to main content
Glama
piyushgIITian

GitHub Enterprise MCP Server

get-enterprise-stats

Retrieve GitHub Enterprise statistics to monitor usage metrics and organizational data for enterprise-level GitHub instances.

Instructions

Get GitHub Enterprise statistics (only available for GitHub Enterprise)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'get-enterprise-stats' tool. It checks if GitHub Enterprise is configured, fetches stats from '/enterprise/stats/all' endpoint, or returns an error message.
    export async function getEnterpriseStats(): Promise<any> {
      const github = getGitHubApi();
      const baseUrl = process.env.GITHUB_API_URL;
    
      // This function is only available for GitHub Enterprise
      if (!baseUrl) {
        return {
          error: 'This function is only available for GitHub Enterprise',
        };
      }
    
      return tryCatchAsync(async () => {
        try {
          // Try to get enterprise stats
          const { data } = await github.getOctokit().request('GET /enterprise/stats/all');
          return data;
        } catch (error) {
          // If not available, return basic information
          return {
            message: 'Enterprise stats not available or insufficient permissions',
            api_url: baseUrl,
          };
        }
      }, 'Failed to get enterprise stats');
    }
  • Registration of the 'get-enterprise-stats' tool in the server's listTools response, including its description and empty input schema.
    {
      name: 'get-enterprise-stats',
      description: 'Get GitHub Enterprise statistics (only available for GitHub Enterprise)',
      inputSchema: {
        type: 'object',
        properties: {},
        additionalProperties: false,
      },
    },
  • Dispatch case in the CallToolRequest handler that invokes the getEnterpriseStats function.
    case 'get-enterprise-stats':
      result = await getEnterpriseStats();
      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 only mentions availability for GitHub Enterprise, missing critical details such as whether this is a read-only operation, authentication requirements, rate limits, or the format of returned statistics. This leaves significant gaps for an agent to understand how to invoke it safely and effectively.

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 and key constraint. It is front-loaded with the main action and resource, with no wasted words or redundant information, making it highly concise and well-structured.

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 enterprise statistics (which could include various metrics), no annotations, and no output schema, the description is incomplete. It fails to explain what statistics are returned, their format, or any behavioral traits like data freshness or access controls, leaving the agent with insufficient context for effective use.

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

Parameters4/5

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

The tool has 0 parameters, and schema description coverage is 100%, so there are no parameters to document. The description doesn't need to add parameter semantics, and it appropriately doesn't mention any. A baseline of 4 is applied as it meets expectations for a parameterless tool.

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 Enterprise statistics'), making the purpose understandable. It distinguishes itself from siblings by focusing on enterprise-level statistics rather than repository, issue, or pull request operations. However, it doesn't specify what specific statistics are included, keeping it from a perfect score.

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

Usage Guidelines3/5

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

The description provides implicit guidance by stating 'only available for GitHub Enterprise,' indicating it should be used in enterprise contexts. However, it lacks explicit when-to-use scenarios, comparisons to alternatives (like general GitHub stats tools if they existed), or prerequisites beyond the enterprise requirement.

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