Skip to main content
Glama
OpenZeppelin

OpenZeppelin Contracts MCP Server

Official
by OpenZeppelin

stylus-erc20

Generate ERC-20 token smart contracts with customizable features like burnable tokens, permit approvals, and flash minting using OpenZeppelin Contracts libraries.

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
burnableNoWhether token holders will be able to destroy their tokens
permitNoWhether without paying gas, token holders will be able to allow third parties to transfer from their account.
flashmintNoWhether to include built-in flash loans to allow lending tokens without requiring collateral as long as they're returned in the same transaction.
infoNoMetadata about the contract and author

Implementation Reference

  • Handler function that processes input parameters and generates Stylus ERC20 contract code using @openzeppelin/wizard-stylus.
    async ({ name, burnable, permit, flashmint, info }) => {
      const opts: ERC20Options = {
        name,
        burnable,
        permit,
        flashmint,
        info,
      };
      return {
        content: [
          {
            type: 'text',
            text: safePrintRustCodeBlock(() => erc20.print(opts)),
          },
        ],
      };
    },
  • Zod schema for validating input parameters of the stylus-erc20 tool (name, burnable, permit, flashmint, info).
    export const erc20Schema = {
      name: z.string().describe(commonDescriptions.name),
      burnable: z.boolean().optional().describe(commonDescriptions.burnable),
      permit: z.boolean().optional().describe(stylusERC20Descriptions.permit),
      flashmint: z.boolean().optional().describe(stylusERC20Descriptions.flashmint),
      ...commonSchema,
    } as const satisfies z.ZodRawShape;
  • Direct registration of the 'stylus-erc20' tool on the MCP server using server.tool().
    return server.tool(
      'stylus-erc20',
      makeDetailedPrompt(stylusPrompts.ERC20),
      erc20Schema,
      async ({ name, burnable, permit, flashmint, info }) => {
        const opts: ERC20Options = {
          name,
          burnable,
          permit,
          flashmint,
          info,
        };
        return {
          content: [
            {
              type: 'text',
              text: safePrintRustCodeBlock(() => erc20.print(opts)),
            },
          ],
        };
      },
    );
  • Top-level call to registerStylusTools which includes registration of stylus-erc20 among other Stylus tools.
    registerStylusTools(server);
Behavior4/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 effectively describes key behaviors: it generates contract source code (a creation operation), returns it in a Markdown code block (output format), and explicitly states 'Does not write to disk' (a critical constraint on persistence). However, it lacks details on error handling, performance limits, or authentication needs.

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, with only two sentences that each earn their place: the first states the core purpose and output, and the second adds a crucial behavioral constraint ('Does not write to disk'). There is zero waste or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (ERC-20 standard generation with 5 parameters, no output schema, and no annotations), the description is mostly complete. It covers the purpose, output format, and a key limitation. However, it lacks details on error cases, dependencies, or how the generated code aligns with ERC-20 specifics, leaving minor gaps for a tool of this nature.

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 5 parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema, such as explaining interactions between parameters (e.g., how 'burnable' affects token functionality). Baseline 3 is appropriate when the schema does the heavy lifting.

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

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Make a fungible token') and resource ('per the ERC-20 standard'), distinguishing it from sibling tools like 'stylus-erc1155' or 'stylus-erc721' which handle different token standards. It also specifies the output format ('Returns the source code... in a Markdown code block'), making the purpose highly specific and differentiated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for generating ERC-20 token contracts, but provides no explicit guidance on when to use this tool versus alternatives like 'solidity-erc20' or 'cairo-erc20' (which target different programming languages or platforms). It mentions 'Does not write to disk,' which hints at a limitation but doesn't clarify alternatives for saving output.

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