Skip to main content
Glama

list_famous_contracts

Retrieve a list of notable smart contracts on the Neo N3 blockchain for either mainnet or testnet environments to enhance blockchain interactions and integrations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
networkNoNetwork to use: "mainnet" or "testnet"

Implementation Reference

  • Direct handler and registration for the 'list_famous_contracts' MCP tool using modern McpServer API. Fetches contracts from ContractService, filters available ones, and returns JSON.
    this.server.tool(
      'list_famous_contracts',
      {
        network: z.string().optional().describe('Network to use: "mainnet" or "testnet"'),
      },
      async ({ network }) => {
        const contractService = await this.getContractService(network);
        const contracts = contractService.listSupportedContracts();
        const availableContracts = contracts.filter(contract => {
          return contractService.isContractAvailable(contract.name);
        });
    
        const result = {
          contracts: availableContracts,
          network: contractService.getNetwork()
        };
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(result, null, 2),
            },
          ],
        };
      }
    );
  • Input schema for the tool: optional network parameter.
    {
      network: z.string().optional().describe('Network to use: "mainnet" or "testnet"'),
    },
  • Core helper method in ContractService that lists supported famous contracts by mapping over FAMOUS_CONTRACTS and checking availability per network.
    listSupportedContracts(): Array<{
      name: string,
      description: string,
      available: boolean,
      operationCount: number,
      network: NeoNetwork
    }> {
      try {
        return Object.values(FAMOUS_CONTRACTS).map(contract => {
          const contractName = contract.name;
          const isAvailable = this.isContractAvailable(contractName);
          const operationCount = Object.keys(contract.operations).length;
    
          return {
            name: contractName,
            description: contract.description,
            available: isAvailable,
            operationCount,
            network: this.network
          };
        });
      } catch (error) {
        // Log the error but return an empty array
        logger.error(`Error listing supported contracts`, {
          error: error instanceof Error ? error.message : String(error),
          network: this.network
        });
        return [];
      }
    }
  • Constant exporting all famous contract definitions (NeoFS, NeoBurger, etc.) with script hashes and operations used by the tool.
    export const FAMOUS_CONTRACTS: { [key: string]: ContractDefinition } = {
      'neofs': NeoFS,
      'neoburger': NeoBurger,
      'flamingo': Flamingo,
      'neocompound': NeoCompound,
      'grandshare': GrandShare,
      'ghostmarket': GhostMarket
    }; 
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/r3e-network/neo-n3-mcp'

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