Skip to main content
Glama
elias-michaias

Onyx Documentation MCP Server

get_onyx_structs

Retrieve struct definitions and code examples for the Onyx programming language from GitHub documentation to understand data structures and implementation patterns.

Instructions

Get Onyx struct definitions and examples from GitHub

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
structNameNoStruct name to search for (optional)
limitNoMaximum number of examples

Implementation Reference

  • Primary handler for get_onyx_structs tool: delegates to SearchEngine for examples and formats MCP response with context.
    async getOnyxStructs(structName, limit = 10) { const results = await this.searchEngine.getOnyxStructExamples(structName, limit); const toolMessage = structName ? `Searching for Onyx struct definitions: "${structName}"` : 'Searching for all available Onyx struct definitions'; return this.formatResponse(JSON.stringify(results, null, 2), toolMessage); }
  • Core helper logic: loads githubPatterns data, filters Onyx struct definitions by optional structName, limits results, and formats output.
    async getOnyxStructExamples(structName = null, limit = 10) { const patterns = await this.loadData('githubPatterns'); if (!patterns) { return { error: 'GitHub patterns not available. Run GitHub crawler first.' }; } let structs = patterns.structs || []; if (structName) { // Filter by struct name (partial match) structs = structs.filter(struct => struct.definition.toLowerCase().includes(structName.toLowerCase()) ); } return { query: structName, totalFound: structs.length, examples: structs.slice(0, limit).map(struct => ({ definition: struct.definition, file: struct.file, repository: struct.repository, url: struct.url })) }; }
  • Tool definition with name, description, and input schema (structName: optional string, limit: optional number default 10). Used for MCP tool listing.
    { 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 } } } },
  • MCP server setup where TOOL_DEFINITIONS provides schemas for list tools request, and tool calls are routed to SharedMcpImplementation.executeTool.
    setupHandlers() { // List all available tools this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: TOOL_DEFINITIONS }; }); // Handle tool calls this.server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; return await this.mcpImpl.executeTool(name, args); }); }
  • Specific dispatcher case in executeTool method that invokes the getOnyxStructs handler for this tool.
    case 'get_onyx_structs': return await this.getOnyxStructs(args.structName, args.limit);

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