Skip to main content
Glama
OpenZeppelin

OpenZeppelin Contracts MCP Server

Official
by OpenZeppelin

solidity-account

Generate ERC-4337 compliant smart contract accounts with customizable signature validation, token reception, and upgradeability options for Ethereum applications.

Instructions

Make an account contract that follows the ERC-4337 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 account contract
signatureValidationNoWhether to implement the ERC-1271 standard for validating signatures. This is useful for the account to verify signatures.
ERC721HolderNoWhether to implement the `onERC721Received` function to allow the account to receive ERC721 tokens.
ERC1155HolderNoWhether to implement the `onERC1155Received` function to allow the account to receive ERC1155 tokens.
signerNoDefines the signature verification algorithm used by the account to verify user operations. Options: - ECDSA: Standard Ethereum signature validation using secp256k1, validates signatures against a specified owner address - EIP7702: Special ECDSA validation using account's own address as signer, enables EOAs to delegate execution rights - Multisig: ERC-7913 multisignature requiring minimum number of signatures from authorized signers - MultisigWeighted: ERC-7913 weighted multisignature where signers have different voting weights - P256: NIST P-256 curve (secp256r1) validation for integration with Passkeys and HSMs - RSA: RSA PKCS#1 v1.5 signature validation (RFC8017) for PKI systems and HSMs - WebAuthn: Web Authentication (WebAuthn) assertion validation for integration with Passkeys and HSMs on top of P256
batchedExecutionNoWhether to implement a minimal batching interface for the account to allow multiple operations to be executed in a single transaction following the ERC-7821 standard.
ERC7579ModulesNoWhether to implement the ERC-7579 compatibility to enable functionality on the account with modules.
infoNoMetadata about the contract and author
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.

Implementation Reference

  • Executes the tool logic: constructs AccountOptions from inputs and generates formatted Solidity account contract code using OpenZeppelin's wizard library.
    async ({
      name,
      signatureValidation,
      ERC721Holder,
      ERC1155Holder,
      signer,
      batchedExecution,
      ERC7579Modules,
      info,
      upgradeable,
    }) => {
      const opts: AccountOptions = {
        name,
        signatureValidation,
        ERC721Holder,
        ERC1155Holder,
        signer,
        batchedExecution,
        ERC7579Modules,
        info,
        upgradeable,
      };
      return {
        content: [
          {
            type: 'text',
            text: safePrintSolidityCodeBlock(() => account.print(opts)),
          },
        ],
      };
    },
  • Zod input schema for validating tool parameters like name, signer type, modules, etc.
    export const accountSchema = {
      name: z.string().describe('The name of the account contract'),
      signatureValidation: z
        .literal(false)
        .or(z.literal('ERC1271'))
        .or(z.literal('ERC7739'))
        .optional()
        .describe(solidityAccountDescriptions.signatureValidation),
      ERC721Holder: z.boolean().optional().describe(solidityAccountDescriptions.ERC721Holder),
      ERC1155Holder: z.boolean().optional().describe(solidityAccountDescriptions.ERC1155Holder),
      signer: z
        .literal(false)
        .or(z.literal('ECDSA'))
        .or(z.literal('EIP7702'))
        .or(z.literal('Multisig'))
        .or(z.literal('MultisigWeighted'))
        .or(z.literal('P256'))
        .or(z.literal('RSA'))
        .or(z.literal('WebAuthn'))
        .optional()
        .describe(solidityAccountDescriptions.signer),
      batchedExecution: z.boolean().optional().describe(solidityAccountDescriptions.batchedExecution),
      ERC7579Modules: z
        .literal(false)
        .or(z.literal('AccountERC7579'))
        .or(z.literal('AccountERC7579Hooked'))
        .optional()
        .describe(solidityAccountDescriptions.ERC7579Modules),
      info: commonSchema.info,
      upgradeable: commonSchema.upgradeable,
    } as const satisfies z.ZodRawShape;
  • Registers the 'solidity-account' tool on the MCP server with name, prompt, schema, and handler function.
    export function registerSolidityAccount(server: McpServer): RegisteredTool {
      return server.tool(
        'solidity-account',
        makeDetailedPrompt(solidityPrompts.Account),
        accountSchema,
        async ({
          name,
          signatureValidation,
          ERC721Holder,
          ERC1155Holder,
          signer,
          batchedExecution,
          ERC7579Modules,
          info,
          upgradeable,
        }) => {
          const opts: AccountOptions = {
            name,
            signatureValidation,
            ERC721Holder,
            ERC1155Holder,
            signer,
            batchedExecution,
            ERC7579Modules,
            info,
            upgradeable,
          };
          return {
            content: [
              {
                type: 'text',
                text: safePrintSolidityCodeBlock(() => account.print(opts)),
              },
            ],
          };
        },
      );
    }
  • Central registry mapping that includes the registerSolidityAccount function for the 'Account' kind, used by registerSolidityTools.
    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),
      };
    }
  • Top-level call to register all Solidity tools, including 'solidity-account', in the MCP server creation.
    registerSolidityTools(server);
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 clearly states the output behavior ('Returns the source code... formatted in a Markdown code block') and clarifies what it doesn't do ('Does not write to disk'), which is valuable. However, it doesn't mention other important behavioral aspects like error conditions, performance characteristics, or authentication requirements.

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 clarifies output format and limitations. There's zero wasted text, and the information is front-loaded appropriately.

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 of a 9-parameter tool with no annotations and no output schema, the description is somewhat incomplete. While it clearly states the purpose and output format, it doesn't provide context about the generated contract's capabilities, limitations, or typical use cases. The description adequately covers the basics but leaves significant gaps for a tool of this complexity.

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?

With 100% schema description coverage, the schema already documents all 9 parameters thoroughly. The description adds no parameter-specific information beyond what's in the schema. According to the scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.

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 an account contract') and resource ('that follows the ERC-4337 standard'), distinguishing it from sibling tools like solidity-custom or solidity-erc20 which handle different contract types. It precisely communicates the tool's function without being tautological.

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 doesn't mention sibling tools like solidity-custom for non-ERC-4337 contracts or explain prerequisites. The only implicit guidance is the ERC-4337 focus, but no explicit usage context or exclusions are provided.

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