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);

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