Skip to main content
Glama
elias-michaias

Onyx Documentation MCP Server

onyx_pkg_build

Generate an Onyx package by specifying a directory and timeout, streamlining package creation for Onyx programming projects.

Instructions

Build an Onyx package using "onyx pkg build" in a specified directory

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
directoryNoDirectory containing the Onyx package (defaults to current working directory).
timeoutNoBuild timeout in seconds

Implementation Reference

  • The handler function that executes the 'onyx pkg build' command in the specified directory. It resolves the directory, checks existence, runs the command with timeout handling using executeOnyxCommand, and formats the MCP response with results or errors.
    async onyxPkgBuild(directory = '.', timeout = 60) { const toolMessage = `Building Onyx package using "onyx pkg build" in directory: ${directory}`; try { // Resolve the target directory const targetDir = path.resolve(directory); // Check if directory exists try { await fs.access(targetDir); } catch (error) { throw new Error(`Directory does not exist: ${targetDir}`); } // Build the Onyx package in target directory const result = await this.executeOnyxCommand(['pkg', 'build'], timeout, targetDir); // Format the response with build results const response = { success: result.success, exitCode: result.exitCode, stdout: result.stdout, stderr: result.stderr, executionTime: result.executionTime, command: 'onyx pkg build', workingDirectory: targetDir }; return this.formatResponse(JSON.stringify(response, null, 2), toolMessage); } catch (error) { const errorResponse = { success: false, error: error.message, command: 'onyx pkg build', workingDirectory: directory }; return this.formatResponse(JSON.stringify(errorResponse, null, 2), toolMessage); } }
  • Input schema for the onyx_pkg_build tool, defining directory (string, default '.') and timeout (number, default 60) parameters.
    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 } } }
  • Registration of the onyx_pkg_build tool in the TOOL_DEFINITIONS array, including name, description, and input schema.
    { 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 } } } },
  • Dispatch registration in the executeTool switch statement that maps the tool name to the onyxPkgBuild handler.
    case 'onyx_pkg_build': return await this.onyxPkgBuild(args.directory, args.timeout);

Other Tools

Related 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