Skip to main content
Glama
elias-michaias

Onyx Documentation MCP Server

get_onyx_functions

Retrieve Onyx programming language function definitions and code examples from GitHub documentation to support development tasks.

Instructions

Get Onyx function definitions and examples from GitHub

Input Schema

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

Implementation Reference

  • The main handler method for the 'get_onyx_functions' tool. It calls the search engine helper and formats the MCP response with context.
    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);
    }
  • Input schema definition for the 'get_onyx_functions' tool within the TOOL_DEFINITIONS array.
    {
      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 }
        }
      }
    },
  • Tool registration in the executeTool dispatcher switch statement, routing calls to the handler.
    case 'get_onyx_functions':
      return await this.getOnyxFunctions(args.functionName, args.limit);
  • Helper method implementing the core logic: loads GitHub code patterns and filters/returns Onyx function examples.
    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
        }))
      };
    }
Behavior2/5

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

With no annotations, the description carries full burden but only states what the tool does without behavioral details. It doesn't disclose if this is a read-only operation, how it handles errors, rate limits, or authentication needs, which are critical for a tool interacting with GitHub.

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, front-loaded with the core purpose. It's appropriately sized for a simple retrieval tool, 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 no annotations and no output schema, the description is incomplete. It doesn't explain what 'definitions and examples' include (e.g., code snippets, metadata), return format, or error handling, leaving gaps for a tool with external dependencies like GitHub.

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 fully documents both parameters. The description adds no additional meaning beyond implying a search capability with 'functionName', but doesn't clarify semantics like search behavior or example types. 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 function definitions and examples'), specifying the source ('from GitHub'). It distinguishes from siblings like 'search_onyx_docs' or 'search_github_examples' by focusing on function definitions, but could be more specific about what 'definitions' entail (e.g., code, metadata).

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?

No explicit guidance on when to use this tool versus alternatives like 'search_ithub_examples' or 'get_onyx_structs' is provided. The description implies a retrieval function, but lacks context on scenarios or prerequisites, leaving usage unclear relative to siblings.

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