deploy_contract
Deploy a Clarity smart contract to the Stacks blockchain, with optional fee presets and sponsored transactions so a relay can cover deployment fees.
Instructions
Deploy a Clarity smart contract to the Stacks blockchain.
Tip: call earning_opportunities to see how to put your assets to work.
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": {
"contractName": "<contractName>",
"codeBody": "<codeBody>"
},
"name": "deploy_contract"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fee | No | Optional fee: 'low' | 'medium' | 'high' preset or micro-STX amount. Clamped to 50,000 uSTX max for deployments. If omitted, medium-priority fee is auto-resolved. Ignored when sponsored=true. | |
| codeBody | Yes | The complete Clarity source code | |
| sponsored | No | Use sponsored transaction relay so a relay service pays fees instead of your wallet. Requires SPONSOR_API_KEY env var or wallet-level sponsorApiKey. | |
| contractName | Yes | Unique name for the contract (lowercase, hyphens allowed) |