Skip to main content
Glama

forge_create

Deploys a smart contract with Foundry, returning the contract address, transaction hash, and deployer; supports private key, keystore, hardware wallet, or cloud KMS signing.

Instructions

Deploy a contract (forge create). Returns the deployed contract address, transaction hash, and deployer. Requires a signing method (private key, keystore, hardware wallet, etc.).

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": {
      "projectPath": "<projectPath>",
      "contractPath": "<contractPath>",
      "rpcUrl": "<rpcUrl>"
    },
    "name": "forge_create"
  }
}

Input Schema

NameRequiredDescriptionDefault
awsNoSign with AWS KMS (requires AWS_KMS_KEY_ID env var)
gcpNoSign with Google Cloud KMS (requires GCP_PROJECT_ID, GCP_LOCATION, GCP_KEY_RING, GCP_KEY_NAME, GCP_KEY_VERSION env vars)
fromNoSender address, used with --unlocked or hardware wallets. Maps to --from for cast/deploy, --sender for forge script.
ledgerNoSign with a Ledger hardware wallet
rpcUrlYesRPC URL of the target network
trezorNoSign with a Trezor hardware wallet
verifyNoVerify the contract after deployment
accountNoNamed keystore account from ~/.foundry/keystores (recommended for production). Create one with: cast wallet import <name> --interactive
profileNoFoundry profile to use (maps to FOUNDRY_PROFILE env var)
keystoreNoPath to an encrypted keystore JSON file
unlockedNoUse eth_sendTransaction with --from address (no local signing). For nodes that manage keys natively.
extraArgsNoAdditional CLI flags
privateKeyNoRaw private key for signing. Only use for local development with well-known test keys (e.g. anvil accounts). For production, use 'account' (named keystore) or hardware wallets instead.
projectPathYesAbsolute path to the foundry project directory
verifierUrlNoBlock explorer verification API URL
contractPathYesContract identifier, e.g. src/MyContract.sol:MyContract
passwordFileNoPath to a file containing the keystore password
constructorArgsNoConstructor arguments as strings
etherscanApiKeyNoEtherscan API key for verification
keystorePasswordNoKeystore password (prefer passwordFile to keep it out of process args)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It usefully discloses the return payload and the signing prerequisite, but leaves out important behavior for a write operation: that deployment spends real gas and is irreversible, and that verify/etherscanApiKey changes post-deploy side effects.

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?

Three short sentences, front-loaded with the action and the return value, followed by the prerequisite. Minor redundancy in repeating 'forge create' from the name, but nothing wasteful.

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 20-parameter deployment tool with no annotations and no output schema, the description covers purpose, return values, and the signing precondition, but omits cost, irreversibility, verification interplay, and network-targeting caveats that an agent needs before invoking a state-changing deploy.

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% across 20 parameters, so the schema already explains each signing method, keystore option, and verification flag in detail. The description only restates that some signing method is required, adding no meaning beyond the schema; baseline 3 applies.

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?

States a specific verb and resource: 'Deploy a contract (forge create)', and names what is produced (contract address, tx hash, deployer). It does not distinguish itself from forge_script, which is the obvious sibling that can also broadcast deployments, so it stops short of a 5.

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 by stating that a signing method is required, which is a genuine precondition. However, it gives no when-to-use versus when-not guidance, no mention of the forge_script or forge_verify alternatives, and no note on testnet versus mainnet contexts.

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