Skip to main content
Glama

OpenZeppelin Contracts MCP Server

Official
by OpenZeppelin

solidity-erc1155

Generate ERC-1155 compliant token contracts with customizable features like burnable, pausable, and mintable options. Returns source code in Markdown without saving to disk.

Instructions

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

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

Input Schema

NameRequiredDescriptionDefault
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.
burnableNoWhether token holders will be able to destroy their tokens
infoNoMetadata about the contract and author
mintableNoWhether privileged accounts will be able to create more supply or emit more tokens
nameYesThe name of the contract
pausableNoWhether privileged accounts will be able to pause specifically marked functionality. Useful for emergency response.
supplyNoWhether to keep track of total supply of tokens
updatableUriNoWhether privileged accounts will be able to set a new URI for all token types
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.
uriYesThe location of the metadata for the token. Clients will replace any instance of {id} in this string with the tokenId.

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "access": { "anyOf": [ { "enum": [ "ownable", "roles" ], "type": "string" }, { "const": "managed", "type": "string" } ], "description": "The 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." }, "burnable": { "description": "Whether token holders will be able to destroy their tokens", "type": "boolean" }, "info": { "additionalProperties": false, "description": "Metadata about the contract and author", "properties": { "license": { "description": "The license used by the contract, default is \"MIT\"", "type": "string" }, "securityContact": { "description": "Email where people can contact you to report security issues. Will only be visible if contract source code is verified.", "type": "string" } }, "type": "object" }, "mintable": { "description": "Whether privileged accounts will be able to create more supply or emit more tokens", "type": "boolean" }, "name": { "description": "The name of the contract", "type": "string" }, "pausable": { "description": "Whether privileged accounts will be able to pause specifically marked functionality. Useful for emergency response.", "type": "boolean" }, "supply": { "description": "Whether to keep track of total supply of tokens", "type": "boolean" }, "updatableUri": { "description": "Whether privileged accounts will be able to set a new URI for all token types", "type": "boolean" }, "upgradeable": { "description": "Whether 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.", "enum": [ "transparent", "uups" ], "type": "string" }, "uri": { "description": "The location of the metadata for the token. Clients will replace any instance of {id} in this string with the tokenId.", "type": "string" } }, "required": [ "name", "uri" ], "type": "object" }

Implementation Reference

  • Handler function that constructs ERC1155Options from inputs and generates Solidity code using OpenZeppelin Wizard's erc1155.print()
    async ({ name, uri, burnable, pausable, mintable, supply, updatableUri, access, upgradeable, info }) => { const opts: ERC1155Options = { name, uri, burnable, pausable, mintable, supply, updatableUri, access, upgradeable, info, }; return { content: [ { type: 'text', text: safePrintSolidityCodeBlock(() => erc1155.print(opts)), }, ], }; },
  • Zod schema defining input parameters for the solidity-erc1155 tool, including name, uri, and various optional features.
    export const erc1155Schema = { name: z.string().describe(commonDescriptions.name), uri: z.string().describe(solidityERC1155Descriptions.uri), burnable: z.boolean().optional().describe(commonDescriptions.burnable), pausable: z.boolean().optional().describe(commonDescriptions.pausable), mintable: z.boolean().optional().describe(commonDescriptions.mintable), supply: z.boolean().optional().describe(solidityERC1155Descriptions.supply), updatableUri: z.boolean().optional().describe(solidityERC1155Descriptions.updatableUri), ...commonSchema, } as const satisfies z.ZodRawShape;
  • Registration function that registers the 'solidity-erc1155' tool on the MCP server with prompt, schema, and handler.
    export function registerSolidityERC1155(server: McpServer): RegisteredTool { return server.tool( 'solidity-erc1155', makeDetailedPrompt(solidityPrompts.ERC1155), erc1155Schema, async ({ name, uri, burnable, pausable, mintable, supply, updatableUri, access, upgradeable, info }) => { const opts: ERC1155Options = { name, uri, burnable, pausable, mintable, supply, updatableUri, access, upgradeable, info, }; return { content: [ { type: 'text', text: safePrintSolidityCodeBlock(() => erc1155.print(opts)), }, ], }; }, ); }
  • Includes the ERC1155 registration in the map of Solidity tool register functions.
    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), }; }
  • Calls registerSolidityTools which in turn registers all Solidity tools including solidity-erc1155.
    registerSolidityTools(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