Skip to main content
Glama
cuongpo

Rootstock MCP Server

by cuongpo

deploy_erc721_token

Deploy a new ERC721 NFT token contract on the Rootstock blockchain. Specify collection name, symbol, and mintable option to create your NFT smart contract using Rootstock MCP Server.

Instructions

Deploy a new ERC721 (NFT) token contract

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
gasLimitNoOptional gas limit
gasPriceNoOptional gas price
mintableNoWhether the NFT should be mintable (default: false)
nameYesNFT collection name (e.g., "My NFT Collection")
symbolYesNFT collection symbol (e.g., "MYNFT")

Implementation Reference

  • MCP tool handler function that gets the current wallet, calls rootstockClient.deployERC721Token with parameters, and returns formatted success response with contract details.
    private async handleDeployERC721Token(params: DeployERC721Params) {
      try {
        const wallet = this.walletManager.getCurrentWallet();
        const result = await this.rootstockClient.deployERC721Token(
          wallet,
          params.name,
          params.symbol,
          params.mintable || false,
          params.gasLimit,
          params.gasPrice
        );
    
        return {
          content: [
            {
              type: 'text',
              text: `ERC721 NFT Contract Deployed Successfully!\n\nContract Address: ${result.contractAddress}\nTransaction Hash: ${result.transactionHash}\nName: ${result.name}\nSymbol: ${result.symbol}\nDeployer: ${result.deployer}${result.gasUsed ? `\nGas Used: ${result.gasUsed}` : ''}${result.blockNumber ? `\nBlock Number: ${result.blockNumber}` : ''}`,
            },
          ],
        };
      } catch (error) {
        throw new Error(`Failed to deploy ERC721 token: ${error}`);
      }
  • src/index.ts:489-516 (registration)
    Tool registration in getAvailableTools() array, defining name, description, and input schema matching DeployERC721Params.
    name: 'deploy_erc721_token',
    description: 'Deploy a new ERC721 (NFT) token contract',
    inputSchema: {
      type: 'object',
      properties: {
        name: {
          type: 'string',
          description: 'NFT collection name (e.g., "My NFT Collection")',
        },
        symbol: {
          type: 'string',
          description: 'NFT collection symbol (e.g., "MYNFT")',
        },
        mintable: {
          type: 'boolean',
          description: 'Whether the NFT should be mintable (default: false)',
        },
        gasLimit: {
          type: 'string',
          description: 'Optional gas limit',
        },
        gasPrice: {
          type: 'string',
          description: 'Optional gas price',
        },
      },
      required: ['name', 'symbol'],
    },
  • TypeScript interface defining input parameters for deploy_erc721_token tool.
    export interface DeployERC721Params {
      name: string;
      symbol: string;
      mintable?: boolean;
      gasLimit?: string;
      gasPrice?: string;
  • Core helper method in RootstockClient that performs the actual ERC721 contract deployment using ethers.js ContractFactory with pre-compiled ABI/bytecode.
    async deployERC721Token(
      wallet: ethers.Wallet | ethers.HDNodeWallet,
      name: string,
      symbol: string,
      mintable: boolean = false,
      gasLimit?: string,
      gasPrice?: string
    ): Promise<ERC721DeploymentResponse> {
      try {
        const connectedWallet = wallet.connect(this.getProvider());
    
        // Check wallet balance first
        const balance = await this.getProvider().getBalance(wallet.address);
        console.log(`Wallet balance: ${ethers.formatEther(balance)} ${this.getCurrencySymbol()}`);
    
        if (balance === 0n) {
          throw new Error(`Wallet has no funds for deployment. Please fund the wallet: ${wallet.address}`);
        }
    
        // Get pre-compiled ERC721 contract
        console.log('Loading ERC721 contract...');
        const compiled = this.getCompiledERC721Contract(mintable);
        console.log('Contract loaded successfully');
    
        // Create contract factory
        const contractFactory = new ethers.ContractFactory(
          compiled.abi,
          compiled.bytecode,
          connectedWallet
        );
    
        console.log(`Deploying ERC721 contract: ${name} (${symbol})`);
    
        // Deploy contract with parameters: name, symbol
        const contract = await contractFactory.deploy(
          name,
          symbol,
          {
            gasLimit: gasLimit ? BigInt(gasLimit) : undefined,
            gasPrice: gasPrice ? BigInt(gasPrice) : undefined,
          }
        );
    
        console.log('Contract deployment transaction sent, waiting for confirmation...');
    
        // Wait for deployment
        const receipt = await contract.deploymentTransaction()?.wait();
        console.log('ERC721 contract deployed successfully!');
    
        const contractAddress = await contract.getAddress();
        console.log(`Contract address: ${contractAddress}`);
    
        return {
          contractAddress,
          transactionHash: contract.deploymentTransaction()?.hash || '',
          name,
          symbol,
          deployer: wallet.address,
          gasUsed: receipt?.gasUsed.toString(),
          blockNumber: receipt?.blockNumber,
        };
      } catch (error) {
        console.error('ERC721 deployment error:', error);
        throw new Error(`Failed to deploy ERC721 token: ${error}`);
      }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states 'deploy' which implies a write operation, but fails to mention critical aspects like gas costs, transaction finality, permissions required, or potential side effects. This leaves significant gaps in understanding the tool's behavior.

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 without unnecessary words. It is front-loaded and wastes no space, 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 deploying a smart contract with no annotations and no output schema, the description is insufficient. It lacks details on return values, error conditions, network dependencies, or integration with other tools like 'estimate_gas' or 'send_transaction', leaving the agent with incomplete context.

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?

The input schema has 100% description coverage, so the schema fully documents all 5 parameters. The description adds no additional parameter information beyond what's in the schema, such as explaining interactions between parameters or usage examples. This meets the baseline for high schema coverage.

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 'deploy' and the resource 'ERC721 (NFT) token contract', making the purpose specific and understandable. However, it doesn't explicitly differentiate from its sibling 'deploy_erc20_token' beyond the token type mentioned in parentheses, which is somewhat implied but not directly contrasted.

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 'deploy_erc20_token' or 'mint_nft', nor does it mention prerequisites such as needing a wallet or network setup. It lacks context for decision-making in the broader toolset.

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

Related 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/cuongpo/rootstock-mcp'

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