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

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