Skip to main content
Glama
OpenZeppelin

OpenZeppelin Contracts MCP Server

Official
by OpenZeppelin

solidity-rwa

Generate ERC-20 token contracts for real-world assets with configurable features like minting, pausing, voting, and cross-chain bridging. Returns source code in Markdown format.

Instructions

Make a real-world asset token that uses the ERC-20 standard. Experimental, some features are not audited and are subject to change.

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.
infoNoMetadata about the contract and author
restrictionsNoWhether to restrict certain users from transferring tokens, either via allowing or blocking them. This feature is experimental, not audited and is subject to change.
freezableNoWhether authorized accounts can freeze and unfreeze accounts for regulatory or security purposes. This feature is experimental, not audited and is subject to change.

Implementation Reference

  • Handler function that receives tool parameters, constructs StablecoinOptions, and returns Solidity code generated by OpenZeppelin's realWorldAsset.print() using safePrintSolidityCodeBlock.
    async ({
      name,
      symbol,
      burnable,
      pausable,
      premint,
      premintChainId,
      mintable,
      callback,
      permit,
      votes,
      flashmint,
      crossChainBridging,
      access,
      info,
      restrictions,
      freezable,
    }) => {
      const opts: StablecoinOptions = {
        name,
        symbol,
        burnable,
        pausable,
        premint,
        premintChainId,
        mintable,
        callback,
        permit,
        votes,
        flashmint,
        crossChainBridging,
        access,
        info,
        restrictions,
        freezable,
      };
      return {
        content: [
          {
            type: 'text',
            text: safePrintSolidityCodeBlock(() => realWorldAsset.print(opts)),
          },
        ],
      };
    },
  • Zod schema definitions for stablecoin/RWA options. rwaSchema is exported as an alias to stablecoinSchema, which extends erc20Schema with restrictions and freezable options.
    export const stablecoinSchema = {
      ...erc20SchemaOmitUpgradeable,
      restrictions: z
        .literal(false)
        .or(z.literal('allowlist'))
        .or(z.literal('blocklist'))
        .optional()
        .describe(solidityStablecoinDescriptions.restrictions),
      freezable: z.boolean().optional().describe(solidityStablecoinDescriptions.freezable),
    } as const satisfies z.ZodRawShape;
    
    export const rwaSchema = stablecoinSchema;
  • Registers the 'solidity-rwa' MCP tool on the server, providing name, detailed prompt from solidityPrompts.RWA, rwaSchema for validation, and the handler function.
    export function registerSolidityRWA(server: McpServer) {
      return server.tool(
        'solidity-rwa',
        makeDetailedPrompt(solidityPrompts.RWA),
        rwaSchema,
        async ({
          name,
          symbol,
          burnable,
          pausable,
          premint,
          premintChainId,
          mintable,
          callback,
          permit,
          votes,
          flashmint,
          crossChainBridging,
          access,
          info,
          restrictions,
          freezable,
        }) => {
          const opts: StablecoinOptions = {
            name,
            symbol,
            burnable,
            pausable,
            premint,
            premintChainId,
            mintable,
            callback,
            permit,
            votes,
            flashmint,
            crossChainBridging,
            access,
            info,
            restrictions,
            freezable,
          };
          return {
            content: [
              {
                type: 'text',
                text: safePrintSolidityCodeBlock(() => realWorldAsset.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 states the tool returns 'source code of the generated contract, formatted in a Markdown code block' and 'Does not write to disk,' which clarifies output format and non-persistence. However, it lacks details on permissions, rate limits, error handling, or other behavioral traits, leaving gaps for a tool with 17 parameters.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and front-loaded, with three sentences that efficiently convey key information: purpose, experimental nature, output format, and non-persistence. Each sentence adds value without redundancy, though it could be slightly more structured for clarity.

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 complexity (17 parameters, no output schema, no annotations), the description is moderately complete. It covers purpose, experimental status, output format, and non-persistence, but lacks details on error cases, performance, or integration context. For a tool generating contract code with many options, more behavioral guidance would enhance completeness.

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?

The input schema has 100% description coverage, so the schema already documents all 17 parameters thoroughly. The description does not add any parameter-specific information beyond what the schema provides, such as explaining interactions between parameters or default behaviors. This meets the baseline for high schema coverage.

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 real-world asset token that uses the ERC-20 standard.' It specifies the verb ('Make'), resource ('real-world asset token'), and standard ('ERC-20'). However, it doesn't explicitly differentiate from sibling tools like 'solidity-erc20' or 'solidity-stablecoin,' which likely have overlapping functionality, so it doesn't reach the highest score.

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 minimal usage guidance. It mentions the tool is 'Experimental, some features are not audited and are subject to change,' which offers a cautionary note but doesn't specify when to use this tool versus alternatives (e.g., compared to 'solidity-erc20' or 'solidity-stablecoin' from the sibling list). There's no explicit when-to-use, when-not-to-use, or alternative tool recommendations.

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