Skip to main content
Glama

evm_deploy_contract

Deploy smart contracts from bytecode with constructor arguments on supported EVM testnets and return the confirmed contract address and transaction hash.

Instructions

Deploy a smart contract from bytecode with constructor arguments.

Creates and deploys a contract to the blockchain using provided bytecode and ABI. Waits for deployment confirmation and returns the deployed contract address.

CRITICAL RULES:

  • Requires sufficient gas for deployment (typically 200k-500k gas)

  • Constructor args must match ABI parameter types exactly

  • Bytecode must be valid and 0x-prefixed hex string

  • Deployer receives all initial state/tokens in contract

  • Contract address is deterministic based on deployer + nonce

PARAMETERS:

  • chain: Target EVM chain for deployment

  • bytecode: Contract bytecode (0x-prefixed hex)

  • abi: Contract ABI including constructor definition

  • constructorArgs: Constructor parameters (optional, empty array if none)

  • privateKey: Deployer's private key (requires gas for deployment)

EXAMPLES: ✅ Deploy simple contract: {chain: "polygon", bytecode: "0x608060...", abi: [...], constructorArgs: [], privateKey: "0x..."}

✅ Deploy with constructor args: {chain: "ethereum", bytecode: "0x608060...", abi: [...], constructorArgs: ["Token Name", "TKN", 18], privateKey: "0x..."}

❌ Invalid - missing bytecode: {chain: "polygon", abi: [...], privateKey: "0x..."}

SUPPORTED EVM CHAINS (7 networks): • ethereum (Sepolia) - EIP-1559 enabled, ~12s blocks, moderate gas costs • polygon (Amoy) - Low fees, fast finality (~2s), layer 2 • avalanche (Fuji C-Chain) - Sub-second finality, dynamic fees • bsc (BNB Testnet) - 3s blocks, low gas costs, Binance ecosystem • arbitrum (Sepolia) - Optimistic rollup, low fees, Ethereum security • base (Sepolia) - Coinbase layer 2, EIP-1559, low fees • worldchain (World Sepolia) - World Network testnet, EIP-1559

CRITICAL GAS CONSIDERATIONS:

  • Ethereum: High gas costs, use gas oracle for timing

  • Polygon/BSC: Very low gas, safe for frequent transactions

  • Arbitrum/Base: L2 optimizations, ~10-50x cheaper than Ethereum

  • Avalanche: Dynamic fees, can spike during congestion

  • Always check gas price before executing transactions

TESTNET TOKENS: All chains use testnet tokens with NO REAL VALUE. Faucets available for all supported networks.

OUTPUT STRUCTURE: • contractAddress: Deployed contract address • transactionHash: Deployment transaction hash • deployer: Deployer address (from private key) • gasUsed: Gas consumed in deployment

COMMON MISTAKES:

  • Not having enough gas for deployment

  • Wrong constructor arg types or order

  • Using malformed bytecode

  • Deploying to wrong chain

USE CASES:

  • Deploy custom tokens or NFT collections

  • Deploy DeFi protocol contracts

  • Deploy governance or DAO contracts

  • Test contract deployment on testnets

Running on Linux.

LINUX-SPECIFIC NOTES:

  • Package manager: apt (Ubuntu/Debian), yum (RHEL/CentOS), or pacman (Arch)

  • Python 3 is typically 'python3' command

  • GNU tools are standard

  • Use 'xdg-open' command to open files/applications

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "chain": "<chain>",
      "bytecode": "<bytecode>",
      "abi": "<abi>",
      "privateKey": "<privateKey>"
    },
    "name": "evm_deploy_contract"
  }
}

Input Schema

NameRequiredDescriptionDefault
abiYesContract ABI for constructor
chainYesEVM chain to deploy on
bytecodeYesContract bytecode (0x-prefixed hex)
privateKeyYesDeployer private key
constructorArgsNoConstructor arguments (optional)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does well: it discloses gas requirements, confirmation waiting, deterministic address derivation, constructor argument constraints, and the output fields. It does not cover failure behavior, irreversibility, or private-key security, which keeps it from a 5.

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

Conciseness2/5

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

The description is heavily bloated, repeats gas considerations across multiple sections, and includes an entirely irrelevant Linux-specific notes section. The heading structure helps readability, but the length and off-topic content violate the principle that every sentence should earn its place.

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

Completeness5/5

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

For a complex deployment tool with five parameters and no output schema, the description covers the output structure, gas requirements, supported chains, constructor argument rules, examples, and common mistakes. It gives an agent enough information to call the tool correctly despite the lack of annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds meaningful context beyond the schema: 0x-prefixed bytecode, constructorArgs empty-array guidance, chain-specific characteristics, and concrete constructor argument examples. This adds real value for correct invocation.

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 states a specific verb and resource: deploying a smart contract from bytecode with constructor arguments. It is clear what the tool does, but it does not explicitly distinguish itself from specialized siblings like evm_deploy_token or evm_deploy_nft.

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 lists use cases such as deploying tokens, NFTs, DeFi contracts, and governance contracts, and provides examples. However, it never says when to use this generic deployment tool versus the specialized deploy tools, and it gives no explicit exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools