Skip to main content
Glama
OpenZeppelin

OpenZeppelin Contracts MCP Server

Official
by OpenZeppelin

solidity-custom

Generate custom smart contract source code with configurable features like access control, upgradeability, and pausability using OpenZeppelin Contracts libraries.

Instructions

Make a custom smart contract.

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
pausableNoWhether privileged accounts will be able to pause specifically marked functionality. Useful for emergency response.
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

  • The handler function for the 'solidity-custom' tool. It constructs CustomOptions from inputs and generates Solidity code using @openzeppelin/wizard's custom.print, returning it as text content.
    async ({ name, pausable, access, upgradeable, info }) => {
      const opts: CustomOptions = {
        name,
        pausable,
        access,
        upgradeable,
        info,
      };
      return {
        content: [
          {
            type: 'text',
            text: safePrintSolidityCodeBlock(() => custom.print(opts)),
          },
        ],
      };
  • Zod schema defining the input parameters for the 'solidity-custom' tool: name (required), pausable (optional), and common fields (access, upgradeable, info).
    export const customSchema = {
      name: z.string().describe(commonDescriptions.name),
      pausable: z.boolean().optional().describe(commonDescriptions.pausable),
      ...commonSchema,
    } as const satisfies z.ZodRawShape;
  • Registers the 'solidity-custom' MCP tool with the server, providing name, prompt, schema, and handler.
    export function registerSolidityCustom(server: McpServer): RegisteredTool {
      return server.tool(
        'solidity-custom',
        makeDetailedPrompt(solidityPrompts.Custom),
        customSchema,
        async ({ name, pausable, access, upgradeable, info }) => {
          const opts: CustomOptions = {
            name,
            pausable,
            access,
            upgradeable,
            info,
          };
          return {
            content: [
              {
                type: 'text',
                text: safePrintSolidityCodeBlock(() => custom.print(opts)),
              },
            ],
          };
        },
      );
    }
  • Includes the custom tool registration in the Solidity tools aggregator function getRegisterFunctions.
    Custom: () => registerSolidityCustom(server),
  • Calls registerSolidityTools in the main server creation, which indirectly registers the 'solidity-custom' tool.
    registerSolidityTools(server);
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden. It discloses that the tool 'Returns the source code... Does not write to disk' which clarifies this is a generation-only tool with no side effects. However, it doesn't mention important behavioral aspects like whether this requires external dependencies, what validation occurs, error conditions, or performance characteristics. The disclosure is minimal but not misleading.

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?

Two sentences with zero waste. The first states the core action, the second clarifies output format and side effect behavior. However, it's somewhat under-specified for a complex tool with 5 parameters and many sibling alternatives - a bit more context would be justified.

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 smart contract generation tool with 5 parameters, no annotations, and no output schema, the description is minimal. While it covers the basic action and output format, it doesn't provide context about the generated contract's structure, security implications, or how it relates to the specialized sibling tools. The agent must rely heavily on parameter schemas to understand what's being generated.

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 fully documents all 5 parameters. The description adds no parameter-specific information beyond what's in the schema. According to guidelines, when schema coverage is high (>80%), the baseline is 3 even with no param info in description, which applies here.

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

Purpose3/5

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

The description states 'Make a custom smart contract' which provides a basic verb+resource, but it's vague about what 'custom' means compared to siblings like solidity-erc20 or solidity-account. It doesn't clearly differentiate this as a general-purpose contract generator versus the specialized sibling tools. The second sentence about return format adds implementation detail but doesn't clarify the core purpose.

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?

No guidance on when to use this tool versus alternatives. With many sibling tools for specific contract types (ERC20, ERC721, governor, etc.), the description provides no context about when a 'custom' contract is appropriate versus using a pre-built specialized template. The agent must infer usage from the tool name alone.

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