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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/enhancedTools.ts:739-759 (handler)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, ], }; }
- src/enhancedTools.ts:246-252 (registration)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: {}, }, },
- src/githubOperations.ts:162-173 (helper)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; } }
- src/githubOperations.ts:178-195 (helper)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; } }