Skip to main content
Glama
elias-michaias

Onyx Documentation MCP Server

list_github_repos

Discover GitHub repositories containing Onyx code, sorted by stars or name to find relevant projects.

Instructions

List all discovered GitHub repositories with Onyx code

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sortByNoSort repositories bystars

Implementation Reference

  • Core handler function that reads GitHub repositories from a JSON file, sorts them by 'stars' or 'name', and returns a formatted list with total count and repository details.
    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 name, description, and input schema specifying the optional 'sortBy' parameter with enum values.
    {
      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 in the executeTool dispatcher switch statement that maps tool calls to the listGitHubRepos handler.
    case 'list_github_repos':
      return await this.listGitHubRepos(args.sortBy);
  • Dynamic HTTP endpoint registration for all tools, with special GET method handling for list_github_repos in the HTTP server.
    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);
    });
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the tool lists repositories but doesn't disclose behavioral traits such as whether it's a read-only operation, potential rate limits, authentication needs, pagination behavior, or what 'discovered' implies (e.g., cached vs. real-time). This leaves significant gaps for safe and effective use.

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?

The description is a single, efficient sentence that front-loads the core purpose ('List all discovered GitHub repositories with Onyx code'). It wastes no words and is appropriately sized for a simple listing tool.

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?

Given the tool's low complexity (1 optional parameter, no output schema, no annotations), the description is minimally adequate. It states what the tool does but lacks details on behavior, usage context, or output format, which are needed for full completeness. The high schema coverage helps, but gaps in guidelines and transparency keep it at a baseline level.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with a well-documented 'sortBy' parameter including enum values and a default. The description adds no parameter-specific information beyond what the schema provides, so it meets the baseline of 3 without adding extra value.

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?

The description clearly states the action ('List') and resource ('GitHub repositories'), and specifies the scope ('with Onyx code'). However, it doesn't differentiate from sibling tools like 'search_github_examples' or 'search_all_sources' that might also involve GitHub repositories, leaving some ambiguity about when this specific listing tool is preferred.

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?

The description provides no guidance on when to use this tool versus alternatives like 'search_github_examples' or 'search_all_sources'. It mentions 'discovered' repositories but doesn't explain what that means or any prerequisites for usage, leaving the agent to guess about context and exclusions.

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

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