Skip to main content
Glama
jezweb

Smart Prompts MCP Server

by jezweb

check_github_status

Verify GitHub connection status and write access to ensure GitHub operations are available for prompt management workflows.

Instructions

Check GitHub connection status and write access. Use this to verify GitHub operations are available.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Main handler for check_github_status tool. Validates GitHub config, checks write access, and returns formatted status report.
    private async handleCheckGitHubStatus(): Promise<CallToolResult> {
      const configValid = await this.githubOps.validateConfig();
      const hasAccess = await this.githubOps.hasWriteAccess();
      
      const text = `# GitHub Status\n\n` +
        `**Configuration Valid:** ${configValid ? '✅ Yes' : '❌ No'}\n` +
        `**Write Access:** ${hasAccess ? '✅ Yes' : '❌ No (read-only)'}\n` +
        `**Repository:** ${configValid ? 'Connected' : 'Not accessible'}\n\n` +
        (hasAccess 
          ? 'You can create and update prompts in GitHub.' 
          : 'You can only read prompts. To enable writing:\n1. Set GITHUB_TOKEN environment variable\n2. Ensure token has "repo" scope\n3. Restart the server');
      
      return {
        content: [
          {
            type: 'text',
            text,
          } as TextContent,
        ],
      };
    }
  • Tool registration in getToolDefinitions(), including name, description, and empty input schema.
      name: 'check_github_status',
      description: 'Check GitHub connection status and write access. Use this to verify GitHub operations are available.',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • Helper method to validate GitHub repository configuration by attempting to fetch repo info.
    async validateConfig(): Promise<boolean> {
      try {
        await this.octokit.repos.get({
          owner: this.config.owner,
          repo: this.config.repo,
        });
        return true;
      } catch (error) {
        console.error('GitHub configuration validation failed:', error);
        return false;
      }
    }
  • Helper method to check if the authenticated user has write (push) permissions to the repository.
    async hasWriteAccess(): Promise<boolean> {
      try {
        if (!this.config.token) {
          return false;
        }
    
        const { data: repo } = await this.octokit.repos.get({
          owner: this.config.owner,
          repo: this.config.repo,
        });
    
        // Check if the authenticated user has push access
        return repo.permissions?.push || false;
      } catch (error) {
        console.error('Error checking write access:', error);
        return false;
      }
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.3/5.0
Behavior4/5

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

Describes that it checks both connection and write access, beyond a simple ping. No annotations exist, so description carries full burden; it provides key behavioral traits.

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?

Two concise sentences with no unnecessary words. Information is front-loaded and efficient.

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?

Adequate for a simple check tool, but lacks description of the return value or expected output, which would be useful since no output schema exists.

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, so schema coverage is 100%. Description adds meaning by specifying the scope (connection and write access), which is useful context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states verb 'Check' and resource 'GitHub connection status and write access'. Differentiates from sibling tools which are all prompt-related.

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

Usage Guidelines4/5

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

Explicitly says 'Use this to verify GitHub operations are available.' providing clear context. No exclusion statements needed as no direct alternative among siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.