Skip to main content
Glama
OpenZeppelin

OpenZeppelin Contracts MCP Server

Official
by OpenZeppelin

cairo-erc721

Generate ERC-721 non-fungible token smart contracts with customizable features like burnable tokens, pausable functionality, minting controls, and royalty management.

Instructions

Make a non-fungible token per the ERC-721 standard.

Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe name of the contract
symbolYesThe short symbol for the token
baseUriNoA base uri for the non-fungible token.
burnableNoWhether token holders will be able to destroy their tokens
pausableNoWhether privileged accounts will be able to pause specifically marked functionality. Useful for emergency response.
mintableNoWhether privileged accounts will be able to create more supply or emit more tokens
enumerableNoWhether to allow on-chain enumeration of all tokens or those owned by an account. Increases gas cost of transfers.
votesNoWhether to keep track of individual units for voting in on-chain governance. Voting durations can be expressed as block numbers or timestamps.
royaltyInfoNoProvides information for how much royalty is owed and to whom, based on a sale price. Follows ERC-2981 standard.
appNameNoRequired when votes is enabled, for hashing and signing typed structured data. Name for domain separator implementing SNIP12Metadata trait. Prevents two applications from producing the same hash.
appVersionNoRequired when votes is enabled, for hashing and signing typed structured data. Version for domain separator implementing SNIP12Metadata trait. Prevents two versions of the same application from producing the same hash.
accessNoThe type of access control to provision. Ownable is a simple mechanism with a single account authorized for all privileged actions. Roles is a flexible mechanism with a separate role for each privileged action. A role can have many authorized accounts.
upgradeableNoWhether the smart contract is upgradeable.
infoNoMetadata about the contract and author

Implementation Reference

  • The handler function for the 'cairo-erc721' tool. It receives input parameters, constructs an ERC721Options object, generates the Cairo contract code using the OpenZeppelin erc721 wizard, and returns it as text content.
    async ({
      name,
      symbol,
      baseUri,
      burnable,
      pausable,
      mintable,
      enumerable,
      votes,
      royaltyInfo,
      appName,
      appVersion,
      access,
      upgradeable,
      info,
    }) => {
      const opts: ERC721Options = {
        name,
        symbol,
        baseUri,
        burnable,
        pausable,
        mintable,
        enumerable,
        votes,
        royaltyInfo,
        appName,
        appVersion,
        access,
        upgradeable,
        info,
      };
      return {
        content: [
          {
            type: 'text',
            text: safePrintCairoCodeBlock(() => erc721.print(opts)),
          },
        ],
      };
    },
  • Zod schema defining the input shape and descriptions for the 'cairo-erc721' tool parameters.
    export const erc721Schema = {
      name: z.string().describe(commonDescriptions.name),
      symbol: z.string().describe(commonDescriptions.symbol),
      baseUri: z.string().optional().describe(cairoERC721Descriptions.baseUri),
      burnable: z.boolean().optional().describe(commonDescriptions.burnable),
      pausable: z.boolean().optional().describe(commonDescriptions.pausable),
      mintable: z.boolean().optional().describe(commonDescriptions.mintable),
      enumerable: z.boolean().optional().describe(cairoERC721Descriptions.enumerable),
      votes: z.boolean().optional().describe(cairoERC721Descriptions.votes),
      royaltyInfo: z
        .object({
          enabled: z.boolean().describe(cairoRoyaltyInfoDescriptions.enabled),
          defaultRoyaltyFraction: z.string().describe(cairoRoyaltyInfoDescriptions.defaultRoyaltyFraction),
          feeDenominator: z.string().describe(cairoRoyaltyInfoDescriptions.feeDenominator),
        })
        .optional()
        .describe(cairoCommonDescriptions.royaltyInfo),
      appName: z.string().optional().describe(cairoCommonDescriptions.appName),
      appVersion: z.string().optional().describe(cairoCommonDescriptions.appVersion),
      ...commonSchema,
    } as const satisfies z.ZodRawShape;
  • Specific registration function for the 'cairo-erc721' tool, called during Cairo tools initialization.
    export function registerCairoERC721(server: McpServer): RegisteredTool {
      return server.tool(
        'cairo-erc721',
        makeDetailedPrompt(cairoPrompts.ERC721),
        erc721Schema,
        async ({
          name,
          symbol,
          baseUri,
          burnable,
          pausable,
          mintable,
          enumerable,
          votes,
          royaltyInfo,
          appName,
          appVersion,
          access,
          upgradeable,
          info,
        }) => {
          const opts: ERC721Options = {
            name,
            symbol,
            baseUri,
            burnable,
            pausable,
            mintable,
            enumerable,
            votes,
            royaltyInfo,
            appName,
            appVersion,
            access,
            upgradeable,
            info,
          };
          return {
            content: [
              {
                type: 'text',
                text: safePrintCairoCodeBlock(() => erc721.print(opts)),
              },
            ],
          };
        },
      );
    }
  • Aggregator function that registers all Cairo tools, including 'cairo-erc721' via registerCairoERC721.
    function getRegisterFunctions(server: McpServer): CairoToolRegisterFunctions {
      return {
        ERC20: () => registerCairoERC20(server),
        ERC721: () => registerCairoERC721(server),
        ERC1155: () => registerCairoERC1155(server),
        Account: () => registerCairoAccount(server),
        Multisig: () => registerCairoMultisig(server),
        Governor: () => registerCairoGovernor(server),
        Vesting: () => registerCairoVesting(server),
        Custom: () => registerCairoCustom(server),
      };
    }
    
    export function registerCairoTools(server: McpServer) {
      Object.values(getRegisterFunctions(server)).forEach(registerTool => {
        registerTool(server);
      });
    }
  • Top-level call to register all Cairo tools (including cairo-erc721) when creating the MCP server.
    registerCairoTools(server);
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: it generates source code (not writes to disk) and returns it formatted. However, it doesn't mention potential side effects (e.g., gas costs, deployment requirements), error conditions, or performance characteristics like rate limits, which are important for a code-generation tool with many parameters.

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 extremely concise (three sentences) and front-loaded with the core purpose. Every sentence earns its place: first states what it does, second specifies output format, third clarifies what it doesn't do. No wasted words or redundant information.

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 complexity (14 parameters, nested objects) and no annotations or output schema, the description is minimally adequate. It covers the basic purpose and output format but lacks details about error handling, security implications, or example usage that would help an agent understand this sophisticated code-generation tool more completely.

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?

Schema description coverage is 100%, so the schema fully documents all 14 parameters. The description adds no parameter-specific information beyond what's in the schema. Baseline score of 3 is appropriate since the schema does all the heavy lifting, but the description doesn't compensate with additional context about parameter interactions or defaults.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Make a non-fungible token') and the specific standard ('ERC-721'), which distinguishes it from sibling tools like cairo-erc20 (fungible tokens) or cairo-erc1155 (semi-fungible tokens). It also specifies the output format ('source code... in a Markdown code block') and what it doesn't do ('Does not write to disk'), making the purpose highly specific and differentiated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by specifying it generates ERC-721 contracts (vs. other standards like ERC-20), but doesn't explicitly state when to use this tool versus alternatives like solidity-erc721 (different language) or cairo-custom (custom contracts). It provides clear output behavior but lacks explicit guidance on tool selection among siblings.

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/OpenZeppelin/contracts-wizard'

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