Skip to main content
Glama
OpenZeppelin

OpenZeppelin Contracts MCP Server

Official
by OpenZeppelin

stylus-erc721

Generate ERC-721 compliant non-fungible token contracts with customizable features like burnability and on-chain enumeration. Returns formatted source code in Markdown, ready for immediate use.

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
burnableNoWhether token holders will be able to destroy their tokens
enumerableNoWhether to allow on-chain enumeration of all tokens or those owned by an account. Increases gas cost of transfers.
infoNoMetadata about the contract and author
nameYesThe name of the contract

Implementation Reference

  • Handler function that constructs ERC721Options from input and generates the Stylus (Rust) contract code using OpenZeppelin's erc721.print()
    async ({ name, burnable, enumerable, info }) => { const opts: ERC721Options = { name, burnable, enumerable, info, }; return { content: [ { type: 'text', text: safePrintRustCodeBlock(() => erc721.print(opts)), }, ], }; },
  • Zod schema defining the input parameters for the stylus-erc721 tool (name, burnable, enumerable, info)
    export const erc721Schema = { name: z.string().describe(commonDescriptions.name), burnable: z.boolean().optional().describe(commonDescriptions.burnable), enumerable: z.boolean().optional().describe(stylusERC721Descriptions.enumerable), ...commonSchema, } as const satisfies z.ZodRawShape;
  • Function that registers the 'stylus-erc721' tool on the MCP server, providing name, prompt, schema, and handler
    export function registerStylusERC721(server: McpServer): RegisteredTool { return server.tool( 'stylus-erc721', makeDetailedPrompt(stylusPrompts.ERC721), erc721Schema, async ({ name, burnable, enumerable, info }) => { const opts: ERC721Options = { name, burnable, enumerable, info, }; return { content: [ { type: 'text', text: safePrintRustCodeBlock(() => erc721.print(opts)), }, ], }; }, ); }
  • Mapping of Stylus tool kinds to their registration functions, including ERC721
    return { ERC20: () => registerStylusERC20(server), ERC721: () => registerStylusERC721(server), ERC1155: () => registerStylusERC1155(server), };
  • Top-level call to register all Stylus tools, which includes stylus-erc721 via the chain.
    registerStylusTools(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