Skip to main content
Glama
Zetrix-Chain

Zetrix MCP Server

Official
by Zetrix-Chain

zetrix_contract_init_dev_environment

Initialize a Zetrix smart contract development environment with project structure, testing framework, and utilities for blockchain application development.

Instructions

Initialize a new Zetrix smart contract development environment using create-zetrix-tool. This creates a complete project structure with testing framework, examples, and utilities.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contractNameYesName of the contract project to create (alphanumeric and hyphens only)
workingDirectoryNoDirectory where to create the project (defaults to current directory)

Implementation Reference

  • src/index.ts:700-717 (registration)
    Tool registration in the tools array, including name, description, and input schema.
    {
      name: "zetrix_contract_init_dev_environment",
      description: "Initialize a new Zetrix smart contract development environment using create-zetrix-tool. This creates a complete project structure with testing framework, examples, and utilities.",
      inputSchema: {
        type: "object",
        properties: {
          contractName: {
            type: "string",
            description: "Name of the contract project to create (alphanumeric and hyphens only)",
          },
          workingDirectory: {
            type: "string",
            description: "Directory where to create the project (defaults to current directory)",
          },
        },
        required: ["contractName"],
      },
    },
  • Input schema definition for the tool parameters: contractName (required), workingDirectory (optional).
    inputSchema: {
      type: "object",
      properties: {
        contractName: {
          type: "string",
          description: "Name of the contract project to create (alphanumeric and hyphens only)",
        },
        workingDirectory: {
          type: "string",
          description: "Directory where to create the project (defaults to current directory)",
        },
      },
      required: ["contractName"],
    },
  • Handler function that validates input, executes 'npx -y create-zetrix-tool {contractName}' in the specified directory, captures output, and returns success message with next steps.
          case "zetrix_contract_init_dev_environment": {
            const { contractName, workingDirectory } = args as {
              contractName: string;
              workingDirectory?: string;
            };
    
            // Validate contract name
            if (!/^[a-zA-Z0-9-_]+$/.test(contractName)) {
              throw new Error("Contract name must contain only alphanumeric characters, hyphens, and underscores");
            }
    
            const { execSync } = await import("child_process");
    
            try {
              const cwd = workingDirectory || process.cwd();
              const command = `npx -y create-zetrix-tool ${contractName}`;
    
              // Execute the command
              const output = execSync(command, {
                cwd,
                encoding: 'utf-8',
                stdio: 'pipe'
              });
    
              return {
                content: [
                  {
                    type: "text",
                    text: `✅ Successfully initialized Zetrix contract development environment!
    
    Project: ${contractName}
    Location: ${cwd}/${contractName}
    
    Output:
    ${output}
    
    Next steps:
    1. cd ${contractName}
    2. Review the generated contract templates
    3. Start developing your smart contract
    4. Use the testing framework to test your contract
    
    The project includes:
    - Contract templates
    - Testing framework (TEST_INVOKE, TEST_QUERY)
    - Example contracts (ZTP20, ZTP721, etc.)
    - Utilities and helpers
    - Documentation
    
    Repository: https://github.com/armmarov/zetrix-contract-development-tool`,
                  },
                ],
              };
            } catch (error) {
              const errorMessage = error instanceof Error ? error.message : String(error);
              throw new Error(`Failed to initialize development environment: ${errorMessage}`);
            }
          }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool creates a project structure, implying a write operation, but doesn't disclose behavioral traits such as permissions needed, whether it overwrites existing directories, error handling, or rate limits. The description adds minimal context beyond the basic action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized with two sentences that are front-loaded with the main action and details. It efficiently conveys the purpose and key features (project structure, testing framework, examples, utilities) without unnecessary elaboration, though it could be slightly more structured.

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

Completeness3/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 moderately complete for a tool with 2 parameters and 100% schema coverage. It covers the purpose and what is created, but lacks details on behavioral aspects like side effects, error cases, or return values, which are important for a tool that initializes an environment.

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 ('contractName' and 'workingDirectory') with clear descriptions. The description adds no additional parameter semantics beyond implying the tool creates a project based on 'contractName', which aligns with 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 ('Initialize') and resource ('Zetrix smart contract development environment'), specifying it uses 'create-zetrix-tool' and creates a project structure with testing framework, examples, and utilities. It distinguishes from siblings like 'zetrix_contract_generate_advanced' by focusing on environment setup rather than contract generation, though it doesn't explicitly name alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for starting a new development environment, but provides no explicit guidance on when to use this tool versus alternatives like 'zetrix_contract_generate_advanced' or prerequisites. It mentions the tool used ('create-zetrix-tool'), which gives some context, but lacks clear when/when-not instructions.

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/Zetrix-Chain/zetrix-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server