Skip to main content
Glama
elias-michaias

Onyx Documentation MCP Server

list_github_repos

Discover and sort GitHub repositories containing Onyx code by stars or name to streamline your search for Onyx projects.

Instructions

List all discovered GitHub repositories with Onyx code

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sortByNoSort repositories bystars

Implementation Reference

  • Main handler function that reads GitHub repositories from data file, sorts them by stars or name, formats and returns the list with total count.
    async listGitHubRepos(sortBy = 'stars') { try { const reposPath = path.join(this.dataDir, 'github', 'repositories.json'); let repos = JSON.parse(await fs.readFile(reposPath, 'utf8')); // Sort repositories switch (sortBy) { case 'stars': repos.sort((a, b) => b.stars - a.stars); break; case 'name': repos.sort((a, b) => a.name.localeCompare(b.name)); break; } const toolMessage = `Listing available GitHub repositories with Onyx code, sorted by ${sortBy}`; return this.formatResponse(JSON.stringify({ totalRepos: repos.length, sortedBy: sortBy, repositories: repos.map(repo => ({ name: repo.fullName, description: repo.description, stars: repo.stars, url: repo.url })) }, null, 2), toolMessage); } catch (error) { const toolMessage = 'Unable to list GitHub repositories - data may not be available yet'; return this.formatResponse( `Repository list not available. Data may need to be populated first. Error: ${error.message}`, toolMessage ); } }
  • Tool schema definition including input schema with sortBy parameter.
    { name: 'list_github_repos', description: 'List all discovered GitHub repositories with Onyx code', inputSchema: { type: 'object', properties: { sortBy: { type: 'string', enum: ['stars', 'name'], description: 'Sort repositories by', default: 'stars' } } } },
  • Registration of the tool handler in the executeTool dispatcher switch statement.
    case 'list_github_repos': return await this.listGitHubRepos(args.sortBy);
  • HTTP endpoint registration using TOOL_DEFINITIONS, with special GET method for this tool.
    TOOL_DEFINITIONS.forEach(tool => { // Special handling for list_github_repos which uses GET const method = tool.name === 'list_github_repos' ? 'GET' : 'POST'; createToolEndpoint(tool.name, method); });
  • src/bridge.js:149-153 (registration)
    Special HTTP method handling (GET) for the tool in MCP-to-HTTP bridge.
    getHttpMethod(toolName) { // Most tools use POST, except list operations const getMethods = ['list_github_repos']; return getMethods.includes(toolName) ? 'GET' : 'POST'; }

Other Tools

Related 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/elias-michaias/onyx_mcp'

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