Skip to main content
Glama
elias-michaias

Onyx Documentation MCP Server

search_all_sources

Search across documentation and GitHub repositories to find Onyx programming language information from multiple sources.

Instructions

Search all crawled content (docs, GitHub, URLs)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query
sourcesNoSources to search in
limitNoMaximum number of results

Implementation Reference

  • The handler function that implements the core logic for the 'search_all_sources' tool. It delegates the search to SearchEngine.searchAll and formats the response.
    async searchAllSources(query, sources = ['docs', 'github'], limit = 10) {
      const results = await this.searchEngine.searchAll(query, sources, limit);
      const toolMessage = `Searching across multiple sources (${sources.join(', ')}) for: "${query}"`;
      return this.formatResponse(JSON.stringify(results, null, 2), toolMessage);
    }
  • The input schema and metadata for the 'search_all_sources' tool, used for MCP tool registration and validation.
    {
      name: 'search_all_sources',
      description: 'Search all crawled content (docs, GitHub, URLs)',
      inputSchema: {
        type: 'object',
        properties: {
          query: { type: 'string', description: 'Search query' },
          sources: { 
            type: 'array', 
            items: { type: 'string', enum: ['docs', 'github'] },
            description: 'Sources to search in',
            default: ['docs', 'github']
          },
          limit: { type: 'number', description: 'Maximum number of results', default: 10 }
        },
        required: ['query']
      }
    },
  • Registration of the tool handler in the executeTool dispatcher switch statement.
    case 'search_all_sources':
      return await this.searchAllSources(args.query, args.sources, args.limit);
  • Key helper method implementing the multi-source search logic, called by the handler. Performs searches on docs and GitHub, combines, ranks, and limits results.
    async searchAll(query, sources = ['docs', 'github'], limit = 10) {
      const results = {
        query,
        sources: sources,
        totalResults: 0,
        resultsBySources: {}
      };
    
      const perSourceLimit = Math.ceil(limit / sources.length);
    
      if (sources.includes('docs')) {
        results.resultsBySources.docs = await this.searchDocs(query, perSourceLimit);
        if (!results.resultsBySources.docs.error) {
          results.totalResults += results.resultsBySources.docs.totalFound || 0;
        }
      }
    
      if (sources.includes('github')) {
        // Search GitHub files directly
        const githubFiles = await this.loadData('githubFiles');
        if (githubFiles) {
          const githubResults = this.searchGitHubFiles(githubFiles, query, perSourceLimit);
          results.resultsBySources.github = githubResults;
          results.totalResults += githubResults.totalFound || 0;
        }
      }
    
      // Combine and rank all results
      const allResults = [];
      
      Object.values(results.resultsBySources).forEach(sourceResults => {
        if (sourceResults.results && !sourceResults.error) {
          sourceResults.results.forEach(result => {
            allResults.push({
              ...result,
              source: sourceResults.source
            });
          });
        }
      });
    
      // Sort by score (higher is better)
      allResults.sort((a, b) => (b.score || 0) - (a.score || 0));
    
      results.combinedResults = allResults.slice(0, limit);
      
      return results;
    }
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 mentions 'crawled content' but doesn't disclose behavioral traits such as whether this is a read-only operation, how results are ranked, if there are rate limits, or what the output format looks like. The description is too vague to provide meaningful behavioral context beyond the basic action.

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 action ('Search all crawled content') with clarifying examples. There is zero waste, and every word earns its place by specifying the scope and types of content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a search tool with 3 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns, how results are structured, or any limitations (e.g., search scope, performance). The agent lacks sufficient context to use this tool effectively beyond basic invocation.

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?

Schema description coverage is 100%, so the schema already documents all parameters (query, sources, limit) with descriptions and defaults. The description adds no additional meaning beyond what the schema provides, such as explaining how the query is processed or what 'sources' like 'docs' and 'github' entail. Baseline 3 is appropriate when the schema does the heavy lifting.

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 verb ('Search') and resource ('all crawled content') with specific examples ('docs, GitHub, URLs'). It distinguishes from siblings like search_github_examples and search_onyx_docs by indicating it searches across multiple sources. However, it doesn't explicitly mention what 'crawled content' entails beyond the examples.

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_onyx_docs. It mentions 'all crawled content' but doesn't specify if this is for broad searches versus more targeted ones, leaving the agent to infer usage from the tool name alone.

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