Skip to main content
Glama
OpenZeppelin

OpenZeppelin Contracts MCP Server

Official
by OpenZeppelin

solidity-erc20

Generate ERC-20 token contract source code with customizable features like burnable, mintable, pausable, voting, and upgradeability options.

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
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.
premintChainIdNoThe chain ID of the network on which to premint tokens.
mintableNoWhether privileged accounts will be able to create more supply or emit more tokens
callbackNoWhether to include support for code execution after transfers and approvals on recipient contracts in a single transaction.
permitNoWhether without paying gas, token holders will be able to allow third parties to transfer from their account.
votesNoWhether to keep track of historical balances for voting in on-chain governance. Voting durations can be expressed as block numbers or timestamps.
flashmintNoWhether to include built-in flash loans to allow lending tokens without requiring collateral as long as they're returned in the same transaction.
crossChainBridgingNoWhether to allow authorized bridge contracts to mint and burn tokens for cross-chain transfers. Options are to use custom bridges on any chain, or the SuperchainERC20 standard with the predeployed SuperchainTokenBridge. The SuperchainERC20 feature is only available on chains in the Superchain, and requires deploying your contract to the same address on every chain in the Superchain.
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".
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

Implementation Reference

  • Handler function that constructs ERC20Options and generates Solidity contract code using OpenZeppelin Wizard's erc20.print().
    async ({
      name,
      symbol,
      burnable,
      pausable,
      premint,
      premintChainId,
      mintable,
      callback,
      permit,
      votes,
      flashmint,
      crossChainBridging,
      access,
      upgradeable,
      info,
    }) => {
      const opts: ERC20Options = {
        name,
        symbol,
        burnable,
        pausable,
        premint,
        premintChainId,
        mintable,
        callback,
        permit,
        votes,
        flashmint,
        crossChainBridging,
        access,
        upgradeable,
        info,
      };
      return {
        content: [
          {
            type: 'text',
            text: safePrintSolidityCodeBlock(() => erc20.print(opts)),
          },
        ],
      };
    },
  • Zod schema defining the input parameters for the solidity-erc20 tool, including options like name, symbol, burnable, etc.
    export const erc20Schema = {
      name: z.string().describe(commonDescriptions.name),
      symbol: z.string().describe(commonDescriptions.symbol),
      burnable: z.boolean().optional().describe(commonDescriptions.burnable),
      pausable: z.boolean().optional().describe(commonDescriptions.pausable),
      premint: z.string().optional().describe(solidityERC20Descriptions.premint),
      premintChainId: z.string().optional().describe(solidityERC20Descriptions.premintChainId),
      mintable: z.boolean().optional().describe(commonDescriptions.mintable),
      callback: z.boolean().optional().describe(solidityERC20Descriptions.callback),
      permit: z.boolean().optional().describe(solidityERC20Descriptions.permit),
      votes: z.literal('blocknumber').or(z.literal('timestamp')).optional().describe(solidityERC20Descriptions.votes),
      flashmint: z.boolean().optional().describe(solidityERC20Descriptions.flashmint),
      crossChainBridging: z
        .literal('custom')
        .or(z.literal('superchain'))
        .optional()
        .describe(solidityERC20Descriptions.crossChainBridging),
      namespacePrefix: z.string().optional().describe(solidityCommonDescriptions.namespacePrefix),
      ...commonSchema,
    } as const satisfies z.ZodRawShape;
  • Function that registers the 'solidity-erc20' tool with the MCP server, including name, prompt, schema, and handler.
    export function registerSolidityERC20(server: McpServer): RegisteredTool {
      return server.tool(
        'solidity-erc20',
        makeDetailedPrompt(solidityPrompts.ERC20),
        erc20Schema,
        async ({
          name,
          symbol,
          burnable,
          pausable,
          premint,
          premintChainId,
          mintable,
          callback,
          permit,
          votes,
          flashmint,
          crossChainBridging,
          access,
          upgradeable,
          info,
        }) => {
          const opts: ERC20Options = {
            name,
            symbol,
            burnable,
            pausable,
            premint,
            premintChainId,
            mintable,
            callback,
            permit,
            votes,
            flashmint,
            crossChainBridging,
            access,
            upgradeable,
            info,
          };
          return {
            content: [
              {
                type: 'text',
                text: safePrintSolidityCodeBlock(() => 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 the full burden of behavioral disclosure. It adds some context: it specifies that the tool 'Returns the source code of the generated contract' and 'Does not write to disk,' which clarifies the output format and non-destructive nature. However, it lacks details on error handling, rate limits, authentication needs, or what happens with invalid inputs, leaving gaps for a tool with 16 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 and front-loaded: it states the core purpose in the first sentence and adds two clarifying sentences about output and behavior. Every sentence earns its place by providing essential information without redundancy, making it efficient and well-structured.

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?

Given the tool's complexity (16 parameters, no output schema, no annotations), the description is somewhat incomplete. It covers the basic purpose and output format but lacks guidance on usage, error handling, and behavioral nuances. However, the high schema coverage mitigates some gaps, making it minimally adequate but with clear room for improvement in contextual details.

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 16 parameters thoroughly. The description adds no parameter-specific information beyond what's in the schema, such as explaining relationships between parameters (e.g., how 'upgradeable' interacts with 'namespacePrefix') or providing examples. This meets the baseline of 3 when schema coverage is high.

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.' This specifies the verb ('Make') and resource ('fungible token'), and distinguishes it from non-ERC-20 token tools. However, it doesn't explicitly differentiate from sibling tools like 'solidity-erc721' or 'solidity-erc1155' beyond the ERC-20 reference, which is implied but not stated.

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 mentions ERC-20 standard but doesn't explain why to choose ERC-20 over other token standards (like ERC-721 or ERC-1155) available in sibling tools, nor does it provide context about prerequisites or typical use cases for ERC-20 tokens.

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