Skip to main content
Glama
lucasliet

GitHub Copilot Usage MCP Server

by lucasliet

get_copilot_usage_summary

Retrieves a concise summary of GitHub Copilot usage, including remaining premium quota and token savings.

Instructions

Obtém um resumo conciso do uso do GitHub Copilot com informações principais, como o restante da quota premium (economiza tokens)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/server.js:27-31 (registration)
    Tool 'get_copilot_usage_summary' is registered in the listToolsHandler with its name, description, and inputSchema.
    {
      name: 'get_copilot_usage_summary',
      description: 'Obtém um resumo conciso do uso do GitHub Copilot com informações principais, como o restante da quota premium (economiza tokens)',
      inputSchema: { type: 'object', properties: {}, required: [] }
    }
  • The callToolHandler dispatches the 'get_copilot_usage_summary' tool to the createUsageSummary function and returns its output.
    if (name === 'get_copilot_usage_summary') {
      const summary = createUsageSummary(usageData);
      return { content: [{ type: 'text', text: summary }] };
    }
  • The createUsageSummary function is the core logic that generates a concise summary of GitHub Copilot usage, focusing on premium interactions quota, chat/completions status, and next reset date.
    export function createUsageSummary(data) {
      const quotas = data.quota_snapshots;
    
      const summaryLines = [];
      summaryLines.push(`📊 **Resumo GitHub Copilot** (${data.copilot_plan})\n`);
    
      // Status mais importante - interações premium
      if (!quotas.premium_interactions.unlimited) {
        const remaining = quotas.premium_interactions.remaining;
        const total = quotas.premium_interactions.entitlement;
        const percent = quotas.premium_interactions.percent_remaining.toFixed(1);
        summaryLines.push(`⭐ **Interações Premium**: ${remaining}/${total} restantes (${percent}%)`);
      }
    
      // Chat e Completions (geralmente ilimitados)
      summaryLines.push(`🗨️ **Chat**: ${quotas.chat.unlimited ? 'Ilimitado' : quotas.chat.remaining + '/' + quotas.chat.entitlement}`);
      summaryLines.push(`💡 **Completions**: ${quotas.completions.unlimited ? 'Ilimitado' : quotas.completions.remaining + '/' + quotas.completions.entitlement}`);
    
      summaryLines.push(`\n📅 **Renovação**: ${formatDate(data.quota_reset_date)}`);
    
      const summary = summaryLines.join('\n');
      return summary;
    }
  • The fetchCopilotUsage function is called first to fetch raw usage data from the GitHub Copilot API, which is then passed to createUsageSummary.
    export async function fetchCopilotUsage(token) {
      try {
        const response = await fetch('https://api.github.com/copilot_internal/user', {
          method: 'GET',
          headers: {
            'Accept': 'application/json',
            'Authorization': `token ${token}`,
            'Editor-Version': 'vscode/1.98.1',
            'Editor-Plugin-Version': 'copilot-chat/0.26.7',
            'User-Agent': 'GitHubCopilotChat/0.26.7',
            'X-Github-Api-Version': '2025-04-01'
          }
        });
    
        if (!response.ok) {
          const errorText = await response.text();
          throw new Error(`Erro na requisição: ${response.status} ${response.statusText}. Detalhes: ${errorText}`);
        }
    
        const data = await response.json();
        return data;
      } catch (error) {
        if (error.name === 'TypeError' && error.message.includes('fetch')) {
          throw new Error('Erro de rede: Não foi possível conectar à API do GitHub. Verifique sua conexão com a internet.');
        }
        throw error;
      }
    }
Behavior2/5

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

No annotations provided; description mentions 'saves tokens' hinting at low cost but doesn't disclose auth requirements, side effects, or error scenarios. Limited behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence conveying purpose and key output information. Efficient for a simple tool, though language may be an issue for non-Portuguese agents.

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?

No output schema and no annotations; description lacks details about return format, prerequisites, or edge cases. For a parameterless tool, it is sparse.

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?

No parameters in the schema; baseline score for zero-parameter tool as per calibration. Description adds no parameter info, but none needed.

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?

Clearly indicates it retrieves a concise summary of GitHub Copilot usage, mentioning specific information like premium quota. Differentiates from siblings (get_copilot_usage and get_copilot_usage_formatted) through 'concise summary'.

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 explicit guidance on when to use this tool versus the sibling tools. The description implies it is for a quick overview, but lacks direct comparison or 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/lucasliet/copilot-usage-mcp'

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