Skip to main content
Glama

zetrix_contract_get_token_standard

Retrieve documentation for Zetrix blockchain token standards (ZTP20, ZTP721, ZTP1155) to understand smart contract specifications and implementation requirements.

Instructions

Get token standard specification (ZTP20, ZTP721, or ZTP1155)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
standardYesToken standard to get documentation for

Implementation Reference

  • Core handler implementation: the `getTokenStandard` method in `ZetrixContractDocs` class that returns detailed Markdown documentation for ZTP20, ZTP721, or ZTP1155 token standards based on the input `standard` parameter.
    getTokenStandard(standard: string): string { if (standard === 'ZTP20') { return `# ZTP20 Token Standard (Fungible Tokens) ## Standard Methods ### Query Methods - **balanceOf(address)** - Get token balance of address - **totalSupply()** - Get total token supply - **allowance(owner, spender)** - Get approved amount ### Transaction Methods - **transfer(to, amount)** - Transfer tokens - **approve(spender, amount)** - Approve spending - **transferFrom(from, to, amount)** - Transfer on behalf ### Events \`\`\`javascript Chain.tlog('Transfer', from, to, amount); Chain.tlog('Approval', owner, spender, amount); \`\`\` ## Variants Available 1. **ZTP20Core** - Basic fungible token 2. **ZTP20Burnable** - Can destroy tokens 3. **ZTP20Permit** - Gasless approvals 4. **ZTP20Pausable** - Emergency stop functionality 5. **ZTP20Capped** - Maximum supply limit ## Example Implementation \`\`\`javascript const ZTP20Core = function() { const self = this; self.transfer = function(to, amount) { const from = Chain.msg.sender; Utils.assert(Utils.addressCheck(to), 'Invalid address'); const fromBalance = self.getBalance(from); const toBalance = self.getBalance(to); Utils.assert( Utils.int256Compare(fromBalance, amount) >= 0, 'Insufficient balance' ); const newFromBalance = Utils.int256Sub(fromBalance, amount); const newToBalance = Utils.int256Add(toBalance, amount); self.setBalance(from, newFromBalance); self.setBalance(to, newToBalance); Chain.tlog('Transfer', from, to, amount); return true; }; }; \`\`\` See SMART_CONTRACT_DEVELOPMENT.md for complete details.`; } else if (standard === 'ZTP721') { return `# ZTP721 Token Standard (Non-Fungible Tokens) ## Standard Methods ### Query Methods - **balanceOf(owner)** - Get NFT count of owner - **ownerOf(tokenId)** - Get owner of NFT - **getApproved(tokenId)** - Get approved address for NFT - **isApprovedForAll(owner, operator)** - Check operator approval ### Transaction Methods - **approve(to, tokenId)** - Approve NFT transfer - **setApprovalForAll(operator, approved)** - Approve all NFTs - **transferFrom(from, to, tokenId)** - Transfer NFT - **safeTransferFrom(from, to, tokenId, data)** - Safe transfer NFT ### Events \`\`\`javascript Chain.tlog('Transfer', from, to, tokenId); Chain.tlog('Approval', owner, approved, tokenId); Chain.tlog('ApprovalForAll', owner, operator, approved); \`\`\` ## Variants Available 1. **ZTP721Core** - Basic NFT 2. **ZTP721Burnable** - Destroyable NFTs 3. **ZTP721Pausable** - Emergency stop 4. **ZTP721Enumerable** - Token enumeration support See SMART_CONTRACT_DEVELOPMENT.md for complete details.`; } else if (standard === 'ZTP1155') { return `# ZTP1155 Token Standard (Multi-Token) ## Standard Methods ### Query Methods - **balanceOf(account, id)** - Get balance of token ID - **balanceOfBatch(accounts, ids)** - Get multiple balances - **isApprovedForAll(account, operator)** - Check operator approval ### Transaction Methods - **setApprovalForAll(operator, approved)** - Approve operator - **safeTransferFrom(from, to, id, amount, data)** - Transfer tokens - **safeBatchTransferFrom(from, to, ids, amounts, data)** - Batch transfer ### Events \`\`\`javascript Chain.tlog('TransferSingle', operator, from, to, id, value); Chain.tlog('TransferBatch', operator, from, to, ids, values); Chain.tlog('ApprovalForAll', account, operator, approved); \`\`\` ## Variants Available 1. **ZTP1155Core** - Basic multi-token 2. **ZTP1155Burnable** - Destroyable tokens 3. **ZTP1155Pausable** - Emergency stop 4. **ZTP1155Supply** - Track total supply per ID 5. **ZTP1155URIStorage** - Token metadata URIs See SMART_CONTRACT_DEVELOPMENT.md for complete details.`; } return 'Unknown token standard'; }
  • Dispatch handler in MCP server: switch case that validates arguments and calls `zetrixContractDocs.getTokenStandard(args.standard)` to execute the tool and format the response.
    case "zetrix_contract_get_token_standard": { if (!args) { throw new Error("Missing arguments"); } const docs = zetrixContractDocs.getTokenStandard(args.standard as string); return { content: [ { type: "text", text: docs, }, ], }; }
  • src/index.ts:685-698 (registration)
    Tool registration: defines the tool name, description, and input schema (requiring 'standard' enum: ZTP20, ZTP721, ZTP1155) in the MCP tools array.
    { name: "zetrix_contract_get_token_standard", description: "Get token standard specification (ZTP20, ZTP721, or ZTP1155)", inputSchema: { type: "object", properties: { standard: { type: "string", enum: ["ZTP20", "ZTP721", "ZTP1155"], description: "Token standard to get documentation for", }, }, required: ["standard"], },
  • Input schema definition: specifies the required 'standard' parameter with enum values for ZTP20, ZTP721, ZTP1155.
    inputSchema: { type: "object", properties: { standard: { type: "string", enum: ["ZTP20", "ZTP721", "ZTP1155"], description: "Token standard to get documentation for", }, }, required: ["standard"],

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