Skip to main content
Glama
Zetrix-Chain

Zetrix MCP Server

Official
by Zetrix-Chain

zetrix_contract_get_structure_guide

Learn how to structure Zetrix smart contracts using ES5 patterns, classes, and inheritance for blockchain development.

Instructions

Get guide on how to structure Zetrix smart contracts with ES5 patterns, classes, and inheritance

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function that returns the detailed guide on Zetrix smart contract structure using ES5 patterns, inheritance, and storage examples.
      getStructureGuide(): string {
        return `# Zetrix Smart Contract Structure Guide
    
    ## ES5 Class Pattern
    
    \`\`\`javascript
    const MyContract = function() {
        const self = this;
    
        // Private variables (local scope)
        const _privateVar = 'private';
    
        // Public variables
        self.publicVar = 'public';
    
        // Protected namespace
        self.p = {};
    
        // Private method
        const _privateMethod = function() {
            return _privateVar;
        };
    
        // Public method
        self.publicMethod = function() {
            return self.publicVar;
        };
    
        // Protected method
        self.p.protectedMethod = function() {
            return _privateMethod();
        };
    
        // Constructor/Initialize
        self.init = function(param1, param2) {
            self.publicVar = param1;
        };
    };
    
    // Entry points
    function init(input) {
        const contract = new MyContract();
        contract.init(input);
    }
    
    function main(input) {
        // Handle transactions
    }
    
    function query(input) {
        // Handle read-only queries
    }
    \`\`\`
    
    ## Inheritance Pattern
    
    \`\`\`javascript
    const ParentContract = function() {
        const self = this;
        self.p = {};
    
        self.p.parentMethod = function() {
            return 'parent';
        };
    };
    
    const ChildContract = function() {
        const self = this;
    
        // Call parent constructor
        ParentContract.call(self);
    
        // Save reference to parent method
        const _parentMethod = self.p.parentMethod;
    
        // Override parent method
        self.p.parentMethod = function() {
            const result = _parentMethod.call(self);
            return result + ' extended';
        };
    };
    \`\`\`
    
    ## Storage Pattern
    
    \`\`\`javascript
    const TokenContract = function() {
        const self = this;
    
        const TOTAL_SUPPLY = 'totalSupply';
        const BALANCE_PREFIX = 'balance_';
    
        self.getBalance = function(address) {
            const key = BALANCE_PREFIX + address;
            return Chain.load(key) || '0';
        };
    
        self.setBalance = function(address, amount) {
            const key = BALANCE_PREFIX + address;
            Chain.store(key, amount);
        };
    };
    \`\`\`
    
    See SMART_CONTRACT_DEVELOPMENT.md for complete guide.`;
      }
  • Tool schema definition including name, description, and empty input schema (no parameters required).
      name: "zetrix_contract_get_structure_guide",
      description: "Get guide on how to structure Zetrix smart contracts with ES5 patterns, classes, and inheritance",
      inputSchema: {
        type: "object",
        properties: {},
      },
    },
  • src/index.ts:1407-1417 (registration)
    Tool registration in the MCP server request handler switch statement, which calls the implementation and formats the response.
    case "zetrix_contract_get_structure_guide": {
      const docs = zetrixContractDocs.getStructureGuide();
      return {
        content: [
          {
            type: "text",
            text: docs,
          },
        ],
      };
    }
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 it 'gets' a guide, implying a read-only operation, but doesn't disclose behavioral traits such as whether it requires authentication, returns static or dynamic content, has rate limits, or error conditions. This is a significant gap for a tool with no 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 front-loads the purpose ('Get guide') and specifies the scope ('how to structure Zetrix smart contracts with ES5 patterns, classes, and inheritance'). There is no wasted verbiage, 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.

Completeness3/5

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

Given the tool has no parameters, no annotations, and no output schema, the description adequately covers the purpose and scope. However, it lacks details on behavioral aspects like return format or error handling, which would be beneficial for a tool with no structured data to rely on, making it minimally complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100%, so no parameter documentation is needed. The description doesn't add parameter semantics, but this is acceptable given the lack of parameters, aligning with the baseline of 4 for zero parameters.

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 verb 'Get' and the resource 'guide on how to structure Zetrix smart contracts', specifying it covers ES5 patterns, classes, and inheritance. It distinguishes from siblings like zetrix_contract_get_testing_guide by focusing on structure rather than testing or other aspects, 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 structuring smart contracts with ES5 patterns, which suggests it's for developers needing guidance on contract design. However, it lacks explicit when-to-use guidance, prerequisites, or comparisons with siblings like zetrix_contract_generate_advanced, leaving usage context somewhat inferred.

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