Skip to main content
Glama

zetrix_contract_get_chain_functions

Retrieve documentation for built-in Chain object functions to develop Zetrix smart contracts effectively.

Instructions

Get documentation for all built-in Chain object functions available in Zetrix smart contracts

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/index.ts:661-668 (registration)
    Tool registration in the tools array, including name, description, and input schema (empty object).
    { name: "zetrix_contract_get_chain_functions", description: "Get documentation for all built-in Chain object functions available in Zetrix smart contracts", inputSchema: { type: "object", properties: {}, }, },
  • MCP tool handler switch case that calls ZetrixContractDocs.getChainFunctions() and returns the documentation as text content.
    case "zetrix_contract_get_chain_functions": { const docs = zetrixContractDocs.getChainFunctions(); return { content: [ { type: "text", text: docs, }, ], }; }
  • Core implementation: method that returns hardcoded Markdown documentation for all Chain object functions used in Zetrix smart contracts.
    getChainFunctions(): string { return `# Zetrix Smart Contract - Chain Object Functions ## Metadata Management - **Chain.store(key, value)** - Store data in contract storage - **Chain.load(key)** - Retrieve data from contract storage - **Chain.del(key)** - Delete data from contract storage ## Account Query Functions - **Chain.getBalance(address)** - Get account balance (returns string) - **Chain.getAccountMetadata(address, key)** - Get account metadata - **Chain.getAccountAsset(address, assetKey)** - Get account assets - **Chain.getAccountPrivilege(address)** - Get account privileges (JSON) - **Chain.getContractProperty(address)** - Get contract properties ## Transaction Functions - **Chain.payCoin(address, amount, input, metadata)** - Transfer ZTX coins - **Chain.payAsset(address, issuer, code, amount, input, metadata)** - Transfer assets - **Chain.issueAsset(code, amount)** - Issue new assets ## Contract Operations - **Chain.contractCall(address, asset, amount, input)** - Call another contract - **Chain.contractQuery(address, input)** - Query another contract (read-only) - **Chain.contractCreate(balance, type, code, input)** - Deploy new contract - **Chain.delegateCall(address, input)** - Execute code in current context - **Chain.delegateQuery(address, input)** - Query in current context ## Logging - **Chain.tlog(topic, arg1, arg2, arg3, arg4, arg5)** - Log transaction event ## Built-in Objects - **Chain.block.number** - Current block number - **Chain.block.timestamp** - Current block timestamp - **Chain.tx.initiator** - Transaction initiator - **Chain.tx.sender** - Transaction sender - **Chain.tx.gasPrice** - Gas price - **Chain.tx.hash** - Transaction hash - **Chain.tx.feeLimit** - Fee limit - **Chain.msg.initiator** - Message initiator - **Chain.msg.sender** - Message sender - **Chain.msg.coinAmount** - Coin amount sent - **Chain.msg.asset** - Asset sent - **Chain.msg.nonce** - Message nonce - **Chain.msg.operationIndex** - Operation index - **Chain.thisAddress** - Current contract address See SMART_CONTRACT_DEVELOPMENT.md for examples.`;

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