Skip to main content
Glama
OpenZeppelin

OpenZeppelin Contracts MCP Server

Official
by OpenZeppelin

cairo-erc20

Generate ERC-20 token contracts for the Cairo language with customizable features like burnable tokens, pausable functionality, and voting capabilities.

Instructions

Make a fungible token per the ERC-20 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
decimalsNoThe number of decimals to use for the contract. Defaults to 18.
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.
premintNoThe number of tokens to premint for the deployer.
mintableNoWhether privileged accounts will be able to create more supply or emit more tokens
votesNoWhether to keep track of historical balances for voting in on-chain governance, with a way to delegate one's voting power to a trusted account.
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 tool handler function that takes ERC20 options, constructs ERC20Options using the input parameters, generates the Cairo ERC20 contract code using the OpenZeppelin wizard's erc20.print method, formats it safely, and returns it as MCP text content.
    async ({
      name,
      symbol,
      decimals,
      burnable,
      pausable,
      premint,
      mintable,
      votes,
      appName,
      appVersion,
      access,
      upgradeable,
      info,
    }) => {
      const opts: ERC20Options = {
        name,
        symbol,
        decimals,
        burnable,
        pausable,
        premint,
        mintable,
        votes,
        appName,
        appVersion,
        access,
        upgradeable,
        info,
      };
      return {
        content: [
          {
            type: 'text',
            text: safePrintCairoCodeBlock(() => erc20.print(opts)),
          },
        ],
      };
    },
  • Zod schema defining and validating all input parameters for the cairo-erc20 tool, including name, symbol, decimals, extensions like burnable, pausable, etc., and common fields.
    export const erc20Schema = {
      name: z.string().describe(commonDescriptions.name),
      symbol: z.string().describe(commonDescriptions.symbol),
      decimals: z.string().optional().describe(cairoERC20Descriptions.decimals),
      burnable: z.boolean().optional().describe(commonDescriptions.burnable),
      pausable: z.boolean().optional().describe(commonDescriptions.pausable),
      premint: z.string().optional().describe(cairoERC20Descriptions.premint),
      mintable: z.boolean().optional().describe(commonDescriptions.mintable),
      votes: z.boolean().optional().describe(cairoERC20Descriptions.votes),
      appName: z.string().optional().describe(cairoCommonDescriptions.appName),
      appVersion: z.string().optional().describe(cairoCommonDescriptions.appVersion),
      ...commonSchema,
    } as const satisfies z.ZodRawShape;
  • Registration of the 'cairo-erc20' tool on the MCP server, including the tool name, detailed prompt from wizard-common, erc20Schema for input validation, and the handler function. This function is called from cairo/tools.ts during server setup.
    export function registerCairoERC20(server: McpServer): RegisteredTool {
      return server.tool(
        'cairo-erc20',
        makeDetailedPrompt(cairoPrompts.ERC20),
        erc20Schema,
        async ({
          name,
          symbol,
          decimals,
          burnable,
          pausable,
          premint,
          mintable,
          votes,
          appName,
          appVersion,
          access,
          upgradeable,
          info,
        }) => {
          const opts: ERC20Options = {
            name,
            symbol,
            decimals,
            burnable,
            pausable,
            premint,
            mintable,
            votes,
            appName,
            appVersion,
            access,
            upgradeable,
            info,
          };
          return {
            content: [
              {
                type: 'text',
                text: safePrintCairoCodeBlock(() => erc20.print(opts)),
              },
            ],
          };
        },
      );
    }
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 states what the tool does (generates contract source code) and what it doesn't do ('Does not write to disk'), which is valuable context. However, it lacks information about execution characteristics like performance, error conditions, authentication requirements, or rate limits that would be important for a code generation tool with 13 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 with just two sentences that each earn their place. The first sentence states the core purpose, and the second provides crucial behavioral context about output format and limitations. 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?

For a complex tool with 13 parameters, no annotations, and no output schema, the description is minimal but covers essential aspects: what it generates and what it doesn't do. However, it lacks information about the generated code's characteristics, deployment considerations, or integration guidance that would be helpful given the tool's complexity and the absence of structured behavioral annotations.

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 already documents all 13 parameters thoroughly. The description adds no parameter-specific information beyond what's in the schema. The baseline score of 3 reflects adequate coverage through the schema alone, though the description doesn't enhance parameter understanding.

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

Purpose4/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 fungible token per the ERC-20 standard' with a specific verb ('Make') and resource ('fungible token'). It distinguishes from some siblings by specifying ERC-20 standard (vs. ERC-721, ERC-1155, etc.), but doesn't explicitly differentiate from 'solidity-erc20' or 'stylus-erc20' which likely serve similar purposes in different languages/frameworks.

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. With multiple ERC-20 generators available (cairo-erc20, solidity-erc20, stylus-erc20), there's no indication of when to choose this Cairo implementation over others, nor any mention of prerequisites, dependencies, or typical use cases beyond token generation.

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