Skip to main content
Glama

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; } }

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/jezweb/smart-prompts-mcp'

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