search_onyx_docs
Search Onyx programming language documentation to quickly find accurate information. Retrieve up to a specified number of results for efficient access to official resources.
Instructions
Search official Onyx programming language documentation
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of results | |
| query | Yes | Search query for documentation |
Implementation Reference
- src/core/mcp-shared.js:198-202 (handler)The main handler function that executes the search_onyx_docs tool logic by querying the search engine for documentation results and formatting the response with context.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); }
- src/core/mcp-shared.js:41-52 (schema)Input schema definition for the search_onyx_docs tool, specifying parameters query (required) and optional limit.{ 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'] } },
- src/core/mcp-shared.js:624-625 (registration)Tool registration in the executeTool dispatcher switch case, mapping the tool name to its handler function.case 'search_onyx_docs': return await this.searchOnyxDocs(args.query, args.limit);
- src/core/mcp-shared.js:38-172 (registration)Central export of all tool definitions array, which includes the search_onyx_docs tool for MCP registration.// Central definition of all MCP tools with their schemas export const TOOL_DEFINITIONS = [ // Documentation search tools { 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'] } }, // GitHub repository tools { name: 'search_github_examples', description: 'Search Onyx code examples from GitHub repositories by topic', inputSchema: { type: 'object', properties: { topic: { type: 'string', description: 'Topic to search for' }, limit: { type: 'number', description: 'Maximum number of examples', default: 5 } }, required: ['topic'] } }, { name: 'get_onyx_functions', description: 'Get Onyx function definitions and examples from GitHub', inputSchema: { type: 'object', properties: { functionName: { type: 'string', description: 'Function name to search for (optional)' }, limit: { type: 'number', description: 'Maximum number of examples', default: 10 } } } }, { name: 'get_onyx_structs', description: 'Get Onyx struct definitions and examples from GitHub', inputSchema: { type: 'object', properties: { structName: { type: 'string', description: 'Struct name to search for (optional)' }, limit: { type: 'number', description: 'Maximum number of examples', default: 10 } } } }, { 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' } } } }, // Unified search tools { 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'] } }, // Code execution tools { name: 'run_onyx_code', description: 'Execute Onyx code and return the output/errors for testing and debugging', inputSchema: { type: 'object', properties: { code: { type: 'string', description: 'Onyx code to execute' }, filename: { type: 'string', description: 'Optional filename (defaults to temp.onyx)', default: 'temp.onyx' }, timeout: { type: 'number', description: 'Execution timeout in seconds', default: 10 } }, required: ['code'] } }, { name: 'run_wasm', description: 'Execute a WebAssembly (WASM) file using "onyx run file.wasm" command', inputSchema: { type: 'object', properties: { wasmPath: { type: 'string', description: 'Path to the WASM file to execute' }, directory: { type: 'string', description: 'Directory to run the command from (defaults to current working directory)', default: '.' }, timeout: { type: 'number', description: 'Execution timeout in seconds', default: 10 } }, required: ['wasmPath'] } }, { name: 'build_onyx_code', description: 'Build Onyx code file using "onyx build" in a specified directory', inputSchema: { type: 'object', properties: { code: { type: 'string', description: 'Onyx code to build' }, filename: { type: 'string', description: 'Filename for the Onyx file', default: 'main.onyx' }, directory: { type: 'string', description: 'Directory to build in (defaults to current working directory)', default: '.' }, timeout: { type: 'number', description: 'Build timeout in seconds', default: 30 } }, required: ['code'] } }, { name: 'onyx_pkg_build', description: 'Build an Onyx package using "onyx pkg build" in a specified directory', inputSchema: { type: 'object', properties: { directory: { type: 'string', description: 'Directory containing the Onyx package (defaults to current working directory)', default: '.' }, timeout: { type: 'number', description: 'Build timeout in seconds', default: 60 } } } }, ];