get_onyx_functions
Retrieve Onyx function definitions and usage examples from GitHub. Specify a function name or set a limit to filter results for detailed programming insights.
Instructions
Get Onyx function definitions and examples from GitHub
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| functionName | No | Function name to search for (optional) | |
| limit | No | Maximum number of examples |
Implementation Reference
- src/core/mcp-shared.js:211-217 (handler)The primary handler function for the 'get_onyx_functions' MCP tool. It invokes the search engine helper, formats a tool-specific message, and returns a formatted MCP response.async getOnyxFunctions(functionName, limit = 10) { const results = await this.searchEngine.getOnyxFunctionExamples(functionName, limit); const toolMessage = functionName ? `Searching for Onyx function examples: "${functionName}"` : 'Searching for all available Onyx function examples'; return this.formatResponse(JSON.stringify(results, null, 2), toolMessage); }
- src/core/search-engine.js:136-161 (helper)Core helper method that loads GitHub code patterns data, filters Onyx function definitions by name if provided, and returns matching examples with file/repo info.async getOnyxFunctionExamples(functionName = null, limit = 10) { const patterns = await this.loadData('githubPatterns'); if (!patterns) { return { error: 'GitHub patterns not available. Run GitHub crawler first.' }; } let functions = patterns.functions || []; if (functionName) { // Filter by function name (partial match) functions = functions.filter(func => func.definition.toLowerCase().includes(functionName.toLowerCase()) ); } return { query: functionName, totalFound: functions.length, examples: functions.slice(0, limit).map(func => ({ definition: func.definition, file: func.file, repository: func.repository, url: func.url })) }; }
- src/core/mcp-shared.js:67-77 (schema)Input schema definition for the 'get_onyx_functions' tool, including parameters for functionName and limit.{ 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 } } } },
- src/core/mcp-shared.js:631-632 (registration)Dispatch registration in the executeTool switch statement, mapping tool name to the handler function.case 'get_onyx_functions': return await this.getOnyxFunctions(args.functionName, args.limit);