Skip to main content
Glama
elias-michaias

Onyx Documentation MCP Server

onyx_pkg_build

Build Onyx packages using the onyx pkg build command in a specified directory with configurable timeout settings.

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 given directory, handles timeouts, captures output, and formats the MCP response.
    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);
      }
    }
  • Tool definition including name, description, and input schema for parameter validation.
      {
        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 }
          }
        }
      },
    ];
  • Dispatcher switch case that routes calls to the onyx_pkg_build handler.
    case 'onyx_pkg_build':
      return await this.onyxPkgBuild(args.directory, args.timeout);
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. It states the tool builds a package, implying a write/mutation operation, but does not disclose behavioral traits like whether it modifies files, requires specific permissions, has side effects, or handles errors. This is inadequate for a build tool with zero annotation coverage.

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 that directly states the tool's purpose and method. It is front-loaded with the core action and includes no unnecessary details, making it highly concise and well-structured.

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 a build operation, no annotations, and no output schema, the description is incomplete. It lacks information on what the build does (e.g., compiles code, creates artifacts), potential outputs, error handling, or dependencies, which are critical for an AI agent to use this tool effectively.

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 already documents both parameters ('directory' and 'timeout') with descriptions and defaults. The description does not add any meaning beyond what the schema provides, such as explaining the build process or parameter interactions, but the baseline is 3 when schema coverage is high.

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 ('Build an Onyx package') and the method ('using "onyx pkg build"'), which is specific and actionable. However, it does not explicitly differentiate from sibling tools like 'build_onyx_code' or 'run_onyx_code', leaving some ambiguity about when to use this versus those alternatives.

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 like 'build_onyx_code' or 'run_onyx_code'. It mentions the directory parameter but does not specify prerequisites, such as requiring an Onyx package structure or dependencies, or when not to use it.

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