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);
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves data from GitHub but doesn't mention rate limits, authentication needs, error handling, or the format of returned data (e.g., raw JSON, structured examples). This leaves significant gaps for a tool interacting with an external service.

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 waste. It's front-loaded with the core purpose and avoids unnecessary details, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of fetching data from GitHub, lack of annotations, and no output schema, the description is incomplete. It doesn't explain what 'definitions and examples' entail, how results are structured, or any behavioral traits like pagination or errors, leaving the agent under-informed for effective use.

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 input schema already documents both parameters ('structName' and 'limit') with descriptions and defaults. The description adds no additional meaning beyond implying a search functionality, which is already suggested by the schema. Baseline 3 is appropriate as 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 action ('Get') and resource ('Onyx struct definitions and examples from GitHub'), making the purpose understandable. However, it doesn't distinguish this tool from sibling tools like 'get_onyx_functions' or 'search_github_examples', which likely have overlapping domains, so it misses full differentiation.

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. With siblings like 'get_onyx_functions', 'search_github_examples', and 'search_onyx_docs', there's no indication of scope, prerequisites, or exclusions, leaving the agent to guess based on tool names 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