Skip to main content
Glama
OpenZeppelin

OpenZeppelin Contracts MCP Server

Official
by OpenZeppelin

solidity-erc721

Generate ERC-721 NFT contract source code with customizable features like minting, burning, pausing, and access control. Returns formatted Solidity code without writing to disk.

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 token
enumerableNoWhether to allow on-chain enumeration of all tokens or those owned by an account. Increases gas cost of transfers.
uriStorageNoAllows updating token URIs for individual token IDs
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
incrementalNoWhether new tokens will be automatically assigned an incremental id
votesNoWhether to keep track of individual units for voting in on-chain governance. Voting durations can be expressed as block numbers or timestamps (defaulting to block number if not specified).
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. Managed enables a central contract to define a policy that allows certain callers to access certain functions.
upgradeableNoWhether the smart contract is upgradeable. Transparent uses more complex proxy with higher overhead, requires less changes in your contract. Can also be used with beacons. UUPS uses simpler proxy with less overhead, requires including extra code in your contract. Allows flexibility for authorizing upgrades.
infoNoMetadata about the contract and author
namespacePrefixNoThe prefix for ERC-7201 namespace identifiers. It should be derived from the project name or a unique naming convention specific to the project. Used only if the contract includes storage variables and upgradeability is enabled. Default is "myProject".

Implementation Reference

  • Registration of the solidity-erc721 tool, including the name, prompt, schema reference, and inline handler function that generates the ERC721 contract code.
    export function registerSolidityERC721(server: McpServer): RegisteredTool {
      return server.tool(
        'solidity-erc721',
        makeDetailedPrompt(solidityPrompts.ERC721),
        erc721Schema,
        async ({
          name,
          symbol,
          baseUri,
          enumerable,
          uriStorage,
          burnable,
          pausable,
          mintable,
          incremental,
          votes,
          access,
          upgradeable,
          namespacePrefix,
          info,
        }) => {
          const opts: ERC721Options = {
            name,
            symbol,
            baseUri,
            enumerable,
            uriStorage,
            burnable,
            pausable,
            mintable,
            incremental,
            votes,
            access,
            upgradeable,
            namespacePrefix,
            info,
          };
          return {
            content: [
              {
                type: 'text',
                text: safePrintSolidityCodeBlock(() => erc721.print(opts)),
              },
            ],
          };
        },
      );
    }
  • The handler function that constructs ERC721Options from input parameters and uses OpenZeppelin Wizard's erc721.print(opts) to generate the Solidity contract source code, wrapped safely and returned as text content.
    async ({
      name,
      symbol,
      baseUri,
      enumerable,
      uriStorage,
      burnable,
      pausable,
      mintable,
      incremental,
      votes,
      access,
      upgradeable,
      namespacePrefix,
      info,
    }) => {
      const opts: ERC721Options = {
        name,
        symbol,
        baseUri,
        enumerable,
        uriStorage,
        burnable,
        pausable,
        mintable,
        incremental,
        votes,
        access,
        upgradeable,
        namespacePrefix,
        info,
      };
      return {
        content: [
          {
            type: 'text',
            text: safePrintSolidityCodeBlock(() => erc721.print(opts)),
          },
        ],
      };
    },
  • Zod schema defining the input parameters for the solidity-erc721 tool, including name, symbol, various ERC721-specific options, common options, and namespacePrefix.
    export const erc721Schema = {
      name: z.string().describe(commonDescriptions.name),
      symbol: z.string().describe(commonDescriptions.symbol),
      baseUri: z.string().optional().describe(solidityERC721Descriptions.baseUri),
      enumerable: z.boolean().optional().describe(solidityERC721Descriptions.enumerable),
      uriStorage: z.boolean().optional().describe(solidityERC721Descriptions.uriStorage),
      burnable: z.boolean().optional().describe(commonDescriptions.burnable),
      pausable: z.boolean().optional().describe(commonDescriptions.pausable),
      mintable: z.boolean().optional().describe(commonDescriptions.mintable),
      incremental: z.boolean().optional().describe(solidityERC721Descriptions.incremental),
      votes: z.literal('blocknumber').or(z.literal('timestamp')).optional().describe(solidityERC721Descriptions.votes),
      ...commonSchema,
      namespacePrefix: z.string().optional().describe(solidityCommonDescriptions.namespacePrefix),
    } as const satisfies z.ZodRawShape;
  • Intermediate registration mapping where registerSolidityERC721 is included in the list of Solidity tools to be registered.
    function getRegisterFunctions(server: McpServer): SolidityToolRegisterFunctions {
      return {
        ERC20: () => registerSolidityERC20(server),
        ERC721: () => registerSolidityERC721(server),
        ERC1155: () => registerSolidityERC1155(server),
        Stablecoin: () => registerSolidityStablecoin(server),
        RealWorldAsset: () => registerSolidityRWA(server),
        Account: () => registerSolidityAccount(server),
        Governor: () => registerSolidityGovernor(server),
        Custom: () => registerSolidityCustom(server),
      };
    }
  • Top-level call to register all Solidity tools, including solidity-erc721 via the chain.
    registerSolidityTools(server);
Behavior3/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It helpfully states that the tool 'Returns the source code of the generated contract, formatted in a Markdown code block' and 'Does not write to disk,' which clarifies output format and side effects. However, it doesn't mention error conditions, performance characteristics, or authentication requirements that might be relevant for a contract generation tool.

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 and well-structured with just two sentences. The first sentence states the core purpose, and the second sentence provides crucial behavioral information about output format and side effects. Every word earns its place with no redundancy.

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?

For a complex tool with 14 parameters and no output schema, the description provides minimal but essential context about what the tool does and its output format. However, it lacks information about error handling, performance, or when to use this specific implementation versus alternatives. The absence of annotations means the description should do more to compensate, but it only partially meets that need.

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, providing detailed documentation for all 14 parameters. The description adds no parameter-specific information beyond what's already in the schema. According to the scoring rules, when schema_description_coverage is high (>80%), the baseline is 3 even with no param info in the description.

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 tool's purpose: 'Make a non-fungible token per the ERC-721 standard.' This specifies both the verb ('Make') and resource ('non-fungible token'), and distinguishes it from sibling tools like 'solidity-erc20' or 'solidity-erc1155' by specifying the ERC-721 standard.

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. It doesn't mention when to choose ERC-721 over other token standards (like ERC-20 or ERC-1155), nor does it explain when to use this specific Solidity implementation versus other sibling tools like 'cairo-erc721' or 'stylus-erc721'.

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