Skip to main content
Glama
elias-michaias

Onyx Documentation MCP Server

search_onyx_docs

Search official Onyx programming language documentation to find answers and code examples for development questions.

Instructions

Search official Onyx programming language documentation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query for documentation
limitNoMaximum number of results

Implementation Reference

  • The primary handler function for the 'search_onyx_docs' tool. It invokes the SearchEngine to perform the documentation search and formats the response with global context and tool-specific message.
    async searchOnyxDocs(query, limit = 5) {
      const results = await this.searchEngine.searchDocs(query, limit);
      const toolMessage = `Searching official Onyx documentation for: "${query}"`;
      return this.formatResponse(JSON.stringify(results, null, 2), toolMessage);
    }
  • The input schema definition for the 'search_onyx_docs' tool, including name, description, parameters (query required, limit optional), as part of TOOL_DEFINITIONS array.
      name: 'search_onyx_docs',
      description: 'Search official Onyx programming language documentation',
      inputSchema: {
        type: 'object',
        properties: {
          query: { type: 'string', description: 'Search query for documentation' },
          limit: { type: 'number', description: 'Maximum number of results', default: 5 }
        },
        required: ['query']
      }
    },
  • Tool registration in the executeTool dispatcher switch statement, mapping the tool name to its handler function.
    case 'search_onyx_docs':
      return await this.searchOnyxDocs(args.query, args.limit);
  • Core search logic helper in SearchEngine class. Loads documentation data from JSON, performs fuzzy search on titles, content, and headings with scoring, sorts results by score, and returns formatted matches.
    async searchDocs(query, limit = 5) {
      const docs = await this.loadData('docs');
      if (!docs) {
        return { error: 'Documentation not available. Run crawler first.' };
      }
    
      const queryLower = query.toLowerCase();
      const results = [];
    
      for (const doc of docs) {
        let score = 0;
        const titleMatch = doc.title.toLowerCase().includes(queryLower);
        const contentMatch = doc.content.toLowerCase().includes(queryLower);
        
        if (titleMatch) score += 10;
        if (contentMatch) score += 1;
        
        // Check headings
        for (const heading of doc.headings || []) {
          if (heading.text.toLowerCase().includes(queryLower)) {
            score += 5;
          }
        }
        
        if (score > 0) {
          results.push({
            ...doc,
            score,
            snippet: this.getSnippet(doc.content, queryLower)
          });
        }
      }
    
      results.sort((a, b) => b.score - a.score);
      
      return {
        query,
        source: 'documentation',
        totalFound: results.length,
        results: results.slice(0, limit).map(r => ({
          title: r.title,
          url: r.url,
          snippet: r.snippet,
          headings: (r.headings || []).map(h => h.text).slice(0, 3),
          score: r.score
        }))
      };
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but offers minimal information. It states the search scope ('official Onyx programming language documentation') but doesn't describe response format, pagination, error conditions, authentication needs, or rate limits. For a search tool with zero annotation coverage, this leaves significant behavioral gaps.

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 with zero wasted words. It's appropriately sized for a simple search tool and front-loads the essential information (search action and target resource).

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?

For a search tool with 2 parameters (100% schema coverage) but no annotations and no output schema, the description is minimally adequate. It specifies the search domain but lacks information about return values, error handling, and behavioral constraints. The description meets basic requirements but doesn't compensate for the missing structured data.

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 both parameters ('query' and 'limit') adequately. The description doesn't add any parameter-specific information beyond what's in the schema, such as query syntax examples or limit constraints. 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 ('official Onyx programming language documentation'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'search_all_sources' or 'search_github_examples', but the specificity about 'Onyx programming language documentation' provides some implicit distinction.

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_all_sources' or 'search_github_examples'. It doesn't mention prerequisites, limitations, or comparative advantages, leaving the agent to infer usage context 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