THORChain MCP Server - Tools Reference
The THORChain MCP server bundles the Bloctopus tool suite for launching local networks, managing infrastructure, and interacting with contracts.
Tool Categories
🏗️ Kurtosis Management Tools – Container orchestration and infrastructure
Manage Kurtosis enclaves, services, files, and engine state - the foundation for running local THORChain environments.
Tools
| Tool | Purpose | Key Actions |
|---|---|---|
kurtosis_enclave | Manage test network environments | ls, inspect, rm, connect, dump |
kurtosis_service | Manage individual services | logs, exec, shell, start, stop |
kurtosis_files | File and artifact management | upload, download, import_web |
kurtosis_system | System-level engine management | clean, engine_status, github_login |
Common operations
| Step | Command | Purpose |
|---|---|---|
| 1 | kurtosis_enclave action="ls" | View active/stopped enclaves |
| 2 | kurtosis_service action="logs" service="thornode" | Inspect service logs |
| 3 | kurtosis_system action="clean" | Remove stopped enclaves and images |
🌐 Network Lifecycle Tools – Deployment, context, and state management
Use these tools to launch THORChain, keep state healthy, and fund development accounts.
Tools
| Tool | Priority | Purpose |
|---|---|---|
kurtosis_thorchain_up | ⚠️ Required first | Network bootstrapper |
thor_context | High | Context and cache management |
thor_service_restart | Medium | Service restart strategies |
thor_state_snapshot | Medium | Development checkpoints |
thor_defaults_refresh | Advanced | Runtime configuration updates |
thor_faucet_fund | Daily use | Development account funding |
Essential commands
| Command | Returns | Use case |
|---|---|---|
kurtosis_thorchain_up | Enclave ID + endpoints | Launch a new network |
thor_context action="resolve" | Current context details | Confirm active network |
thor_faucet_fund to_address="thor1..." amount="100000000" denom="rune" | Transaction hash | Fund an account |
📊 THORChain API Tools – Read-only blockchain queries
Read-only API clients for inspecting accounts, contracts, pools, and network state without changing chain data.
Tools
| Tool | Queries | Gas cost |
|---|---|---|
thor_api_accounts | Account metadata, balances | None |
thor_api_cosmwasm | Smart contract state | None |
thor_api_liquidity | Pool data, inbound addresses | None |
thor_api_network | Network stats, Mimir, blocks | None |
thor_api_transactions | Transaction details, search | None |
Common queries
| Goal | Command | Returns |
|---|---|---|
| Check balance | thor_api_accounts action="balances" | All balances |
| Query contract | thor_api_cosmwasm action="query" address="thor1..." query='{...}' | Contract state |
| Get network stats | thor_api_network action="network" | Bond and liquidity metrics |
⚡ THORChain CLI Tools – Transaction execution and account management
CLI wrappers for sending transactions, managing keys, and handling CosmWasm deployments.
Tools
| Tool | Purpose | Modifies state |
|---|---|---|
thor_cli_bank | Banking operations (send tokens) | ✅ |
thor_cli_keys | Key management | ❌ (local) |
thor_cli_tx | Transaction signing/broadcasting | ✅ |
thor_cli_memo_tx | THORChain-specific memos | ✅ |
thor_cli_thorchain_mimir | Governance parameters | ✅ |
thor_cli_wasm | CosmWasm contract lifecycle | ✅ |
Essential operations
| Operation | Command | Impact |
|---|---|---|
| Create key | thor_cli_keys action="add" args="mykey" | Adds key to local keyring |
| Send tokens | thor_cli_bank action="send" args="thor1... 1000rune" | Broadcasts bank send |
| Deploy contract | thor_cli_wasm action="deploy" wasm_file="contract.wasm" instantiate_msg='{...}' | Stores and instantiates contract |
🔍 Monitoring & Health Tools – Real-time monitoring and health checks
Monitor network health, dependency readiness, and transaction progress.
Tools
| Tool | Real-time | Purpose |
|---|---|---|
thor_stream | ✅ | Event streaming and transaction waits |
thor_health | ❌ | Node and subsystem health probes |
setup_health | ❌ | Docker/Kurtosis dependency check |
Monitoring commands
| Command | Type | Use case |
|---|---|---|
thor_health action="ready" | Snapshot | CI/CD readiness gate |
thor_stream action="wait_for" tx_hash="ABC123..." | Real-time | Wait for a transaction |
setup_health | Snapshot | Verify local prerequisites |
🔬 Schema & Discovery Tools – Contract interface discovery
Discover available schemas, translate natural-language intents, and locate supported contracts.
Tools
| Tool | Input | Output | Critical |
|---|---|---|---|
contract_schema_list | None | Embedded schema names | No |
contract_schema_info | Schema file + function | Function signature | No |
contract_smart_build | Natural language intent | Complete message + address | 🌟 Required |
cosmwasm_contract_find | Natural language query | Contract address | No |
Schema workflow
| Step | Command | Returns |
|---|---|---|
| 1 | contract_smart_build user_intent="swap btc for usdc on fin" | Contract + message |
| 2 | cosmwasm_contract_find query="eth usdc pool" | Matching contract address |
Detailed Tool Reference
Kurtosis Management Tools
kurtosis_enclave
Primary interface for managing Kurtosis enclaves (isolated test network environments).
Actions
| Action | Purpose | Parameters | Impact |
|---|---|---|---|
ls | List all enclaves | None | Safe |
inspect | Get detailed info | enclave (optional) | Safe |
rm | Remove enclave | enclave, force (optional) | Destructive |
connect | Port forward | enclave, service, ports | Network |
dump | Export state | enclave | Safe |
add | Create empty enclave | enclave | Creates Resources |
stop | Stop enclave | enclave | Stops Services |
- Auto-detects enclave names containing
"thor" - Supports custom enclave names via the
enclaveparameter - Returns structured JSON for inspection operations
Examples
kurtosis_enclave action="ls"
# Returns: ["thorchain-test", "my-network"]
kurtosis_enclave action="inspect" enclave="thorchain-test"
# Returns: Services, ports, UUID, creation time
kurtosis_enclave action="rm" enclave="old-network" force=true
See Also: kurtosis_service, kurtosis_system
kurtosis_service
Manage individual services within Kurtosis enclaves.
Actions
🔍 Debug Actions
| Action | Purpose | Key Parameters | Safety |
|---|---|---|---|
logs | View service logs | num, follow, filter | Safe |
exec | Execute command | command (required), user | Caution |
shell | Interactive shell | shell (default: /bin/sh) | Caution |
inspect | Service details | Format: JSON/YAML | Safe |
⚙️ Lifecycle Actions
| Action | Purpose | Impact |
|---|---|---|
start | Start stopped service | Modifies State |
stop | Stop running service | Service Unavailable |
update | Update configuration | Config Changes |
rm | Remove service | Permanent Deletion |
- Log filtering supports match, regex, and inversion
- Exec commands run as root by default (customizable with
userparameter) - Service inspection returns JSON/YAML format
Examples
kurtosis_service action="logs" enclave="thorchain-test" service="thornode" num=100
# Returns: Last 100 log lines
kurtosis_service action="exec" enclave="thorchain-test" service="thornode" command="ls -la /root"
kurtosis_service action="logs" service="thornode" follow=true
# Streams logs continuously
See Also: kurtosis_enclave
kurtosis_files
File and artifact management within Kurtosis enclaves.
Actions
| Action | Purpose | Source/Target | Persists |
|---|---|---|---|
upload | Upload local files | Local filesystem → Enclave | ✅ Yes |
download | Download artifact | Enclave → Local filesystem | N/A |
inspect | View artifact contents | Enclave artifact | N/A |
import_web | Import from URL | HTTP/HTTPS → Enclave | ✅ Yes |
render_template | Render Go templates | Template + JSON data | ✅ Yes |
store_service | Capture service file | Service file → Artifact | ✅ Yes |
- Artifacts persist across service restarts
- Supports directory uploads (recursive)
- Web imports support tar.gz, zip, and raw files
Examples
kurtosis_files action="upload" enclave="thorchain-test" artifacts_source="/local/config.json"
kurtosis_files action="download" enclave="thorchain-test" artifact_identifier="app-logs"
kurtosis_files action="import_web" url="https://example.com/config.tar.gz"
See Also: kurtosis_service
kurtosis_system
System-level Kurtosis engine management and resource cleanup.
Actions
🔧 Engine Management
| Action | Purpose | Impact |
|---|---|---|
engine_start | Start Kurtosis engine | Engine Becomes Active |
engine_stop | Stop engine gracefully | All Enclaves Stop |
engine_restart | Restart with new settings | Brief Downtime |
engine_status | Check health & version | Read-Only |
engine_logs | Export logs | Read-Only |
🗑️ Cleanup
| Action | Scope | Disk Space Freed |
|---|---|---|
clean | Stopped enclaves only | Moderate |
clean all=true | ⚠️ ALL enclaves | Maximum |
clean removes only stopped enclaves by default. Using clean all=true removes ALL enclaves including running ones!
🔐 GitHub Auth
| Action | Purpose | Required For |
|---|---|---|
github_login | Authenticate with GitHub | Private repos |
github_logout | Remove authentication | Security |
github_status | Check auth status | Verification |
- Engine control affects all running enclaves
- Clean command removes stopped enclaves by default (use
all=truefor running enclaves) - GitHub authentication persists across engine restarts
Examples
kurtosis_system action="clean"
# Frees disk space
kurtosis_system action="engine_status"
# Returns: Version, status, uptime
kurtosis_system action="github_login"
# Required for private packages
See Also: kurtosis_enclave
Network Lifecycle Tools
kurtosis_thorchain_up
Primary network bootstrapper - launches complete THORChain development networks.
MUST be called before any thor_cli_* or thor_api_* operations.
Actions
| Parameter | Default | Purpose |
|---|---|---|
enable_forking | true | Launch from forked mainnet vs. fresh devnet |
block_height | 23000000 | Fork height when forking mainnet |
enclave | auto-generated | Name for the Kurtosis enclave |
args_file | – | YAML overrides for advanced configuration |
Behavior
- Bootstraps thornode, bifrost, midgard, and faucet services
- Waits for health checks before returning
- Caches connection details for
thor_context
Examples
kurtosis_thorchain_up enclave="thorchain-test"
# Launches at block 23,000,000
# Ready in ~2 minutes
kurtosis_thorchain_up enclave="my-devnet" enable_forking=false
# Ready in ~30 seconds
See Also: thor_context
thor_context
Context management and cache coordination for network state.
Actions
| Action | Mode | Auto-detect | Updates cache | Returns |
|---|---|---|---|---|
resolve | Read-only | ✅ Yes | ❌ No | Full context object with endpoints |
use | Modifies state | ❌ No (explicit selection) | ✅ Yes | Confirmation with cached endpoints |
💾 Cache Fields
| Field | Type | Priority | Purpose |
|---|---|---|---|
Enclave | string | Required | Active environment identifier |
Service | string | Required | THORChain service name (e.g., thornode-node-1) |
APIAddress | URL | Required | REST API endpoint for HTTP queries |
RPCAddress | URL | Important | CometBFT RPC endpoint for consensus queries |
WSAddress | WebSocket | Important | WebSocket endpoint for event streaming |
ServicePorts | Dictionary | Optional | Port mapping for all exposed services |
THORChain-named enclaves → first available → mainnet fallback
Examples
thor_context action="resolve"
# Returns: {"enclave": "thorchain-test", "service": "thornode-node-1", ...}
thor_context action="use" enclave="thorchain-test" service="thornode-node-1"
# Persists selection, discovers ports
See Also: kurtosis_thorchain_up
thor_service_restart
Service restart management with multiple strategies.
Actions
| Mode | Purpose | Typical Use |
|---|---|---|
single | Restart one service and wait for health confirmation | Apply config changes to a single component |
rolling | Restart services sequentially based on selector | Upgrade multiple thornode/bifrost instances safely |
health | Restart only services failing health checks | Automated recovery workflows |
Parameters
service: Explicit service name (forsinglemode)selector: Wildcard to match multiple services (forrollingmode)services: Comma-separated list evaluated for health (forhealthmode)wait_ready_timeout: Seconds to wait for health checks (default 60)
Examples
thor_service_restart mode="single" service="thornode"
thor_service_restart mode="rolling" selector="thornode*"
thor_service_restart mode="health" services="thornode,midgard,faucet"
See Also: thor_health
thor_state_snapshot
Development state checkpoint creation for THORChain networks.
Actions
| Action | Scope | Includes | Typical Size |
|---|---|---|---|
capture | min | Configuration files only | ~2 MB |
capture | node | Config + thornode data + WASM contracts | ~500 MB |
capture | full | Node scope + Midgard and indexers | ~2 GB |
Snapshots are written to ~/.thorchain-mcp/artifacts and uploaded to the Kurtosis artifact store for reuse across enclaves.
Examples
thor_state_snapshot name="contracts-deployed" scope="node"
# Captures blockchain state with contracts (~500 MB)
thor_state_snapshot name="clean-state" scope="min"
# Configuration only (~2 MB)
See Also: kurtosis_thorchain_up
thor_defaults_refresh
Runtime configuration update for THORChain networks.
Actions
| Action | Purpose | Behavior |
|---|---|---|
refresh | Merge updated thorchain_defaults.json into thornode | Uploads config, merges JSON, restarts thornode when changes apply |
Notes
- Requires an active context from
thor_context - Safe to re-run; restarts only when merge succeeds
Examples
thor_defaults_refresh
# Merges new defaults and restarts thornode
See Also: thor_service_restart
thor_faucet_fund
Development account funding via embedded faucet service.
Actions
| Parameter | Purpose | Notes |
|---|---|---|
to_address | Recipient THORChain address | Must be bech32 (thor1...) |
amount | Amount in base units | Optional when using presets |
denom | Asset to request (e.g., rune, btc, btc/btc) | Defaults to rune |
thornode_api | Custom API endpoint | Overrides cached context |
Supports secured assets (btc), trade assets (btc~btc), and synthetic assets (btc/btc).
Examples
thor_faucet_fund to_address="thor1abc..." amount="100000000" denom="rune"
# Funds with 100 RUNE
thor_faucet_fund to_address="thor1abc..." amount="100000000" denom="btc"
# Funds with 1 BTC secured asset
thor_faucet_fund to_address="thor1abc..." amount="100000000" denom="btc/btc"
# Funds with synthetic BTC
See Also: thor_api_accounts, thor_cli_bank
THORChain API Tools
thor_api_accounts
Account and balance query interface for THORChain addresses.
Actions
📋 Account Metadata
Purpose: Get account metadata required for transaction signing
Returns: account_number, sequence, pub_key
When to use: Before creating and signing transactions
thor_api_accounts action="account" address="thor1xyz..."
# Returns: {"account_number": 123, "sequence": 5, "pub_key": "..."}
💰 Check Balances
Purpose: Query all token balances or filter by denomination
Returns: List of all balances with amounts
When to use: Verify funding before operations
thor_api_accounts action="balances" denom="rune"
# Returns: [{"denom": "rune", "amount": "1000000"}]
✅ Spendable Only
Purpose: Get only spendable balances (excludes locked/delegated)
Returns: Available balances for immediate use
When to use: Calculate maximum transaction amounts
thor_api_accounts action="spendable"
# Returns: Only immediately available balances
| Action | Purpose | Priority | Returns |
|---|---|---|---|
account | Get TX signing metadata | Required for TX | account_number, sequence, pub_key |
balances | Check all balances | Pre-TX verification | All denominations with amounts |
spendable | Available balances only | Optional filter | Unlocked balances |
Technical Details:
- Address parameter defaults to cached key (most recently used)
- Supports explicit address override
- Balance queries support denom filtering
Examples
thor_api_accounts action="balances"
# Returns: All balances for cached account
thor_api_accounts action="account" address="thor1xyz..."
# Returns: account_number, sequence, pub_key
thor_api_accounts action="balances" denom="rune"
# Returns: RUNE balance only
See Also: thor_cli_keys, thor_faucet_fund
thor_api_cosmwasm
Read-only interface for CosmWasm smart contract operations.
Query action REQUIRES schema discovery from contract_smart_build first. HTTP 500 errors mean you're using the wrong query format - never guess the schema!
Actions
🔍 Query State
| Action | Priority | Schema Needed | Use Case |
|---|---|---|---|
query | 🔴 Critical | YES | Read contract state |
ALWAYS run contract_smart_build before using query. The schema must match exactly or you'll get HTTP 500 errors.
📄 Metadata
| Action | Purpose | Schema | Returns |
|---|---|---|---|
contract_info | Get contract metadata | No | code_id, creator, admin, label |
code_info | Get code metadata | No | permissions, checksum |
codes | List all WASM codes | No | Array of code IDs |
🔎 Search
| Action | Purpose | Filters | Schema |
|---|---|---|---|
find | Search contracts | code_id, label, creator | No |
contracts_by_code | List instances of code ID | code_id (required) | No |
- Query requires discovered schema from
contract_smart_build - Supports pagination for list operations
- Code info includes instantiate permissions
Examples
# Step 1: Discover schema
contract_smart_build user_intent="get pool from bow"
# Step 2: Execute query
thor_api_cosmwasm action="query" address="thor1..." query='{"get_pool_state":{}}'
thor_api_cosmwasm action="contract_info" address="thor1..."
thor_api_cosmwasm action="contracts_by_code" code_id=123
See Also: contract_smart_build, thor_cli_wasm
thor_api_liquidity
Liquidity pool and routing query interface.
Actions
| Action | Purpose | Parameters | Priority |
|---|---|---|---|
list | Get pool summaries | None | Discovery |
snapshot | Detailed pool info | asset (e.g., BTC.BTC) | Pool details |
inbound_for | Get inbound address | chain_or_asset | Cross-chain ops |
Technical Details:
- Pool snapshot requires asset identifier (e.g.,
BTC.BTC) - Inbound addresses used for cross-chain swaps
- Pool list includes all active pools with basic stats
Examples
thor_api_liquidity action="list"
# Returns: All pools with depths and status
thor_api_liquidity action="snapshot" asset="BTC.BTC"
# Returns: Detailed BTC pool statistics
thor_api_liquidity action="inbound_for" chain_or_asset="BTC"
# Returns: Inbound address for BTC chain
thor_api_network
Network state, configuration, and block data queries.
Actions
| Action | Purpose | Notes |
|---|---|---|
network | High-level liquidity and bond metrics | Default view for dashboards |
mimir | Governance parameter dump | Includes 200+ configuration keys |
queue | Swap / outbound queue status | Useful for debugging congestion |
block | Fetch block data (pass height) | Returns header + tx hashes |
constants | Current THORChain constants | Mirrors on-chain constant values |
version | Thornode version info | Helpful for verifying upgrades |
pool_snapshot | (Deprecated) use thor_api_liquidity | Provided for completeness |
Examples
thor_api_network action="mimir"
# Returns: All governance parameters
thor_api_network action="queue"
# Returns: Swap/outbound/internal counts
thor_api_network action="network"
# Returns: Bond metrics, liquidity totals
See Also: thor_cli_thorchain_mimir
thor_api_transactions
Transaction query, search, and gas estimation interface.
Actions
| Action | Purpose | Notes |
|---|---|---|
get | Fetch transaction by hash | Returns full decoded result |
search | Tendermint event search | Requires indexed events (set query) |
wait | Wait for tx hash to confirm | Polls until included or timeout |
simulate | Estimate gas from tx bytes | Use before broadcasting custom tx |
Examples
thor_api_transactions action="get" hash="64CA86308E06FE2CEF7DBF3F4D5EF38C06FF42FB3FA35119CEA38D21814D25FB"
# Returns: Full transaction details with events
thor_api_transactions action="search" query="message.sender='thor1...'"
# Requires index-events configuration
See Also: thor_cli_tx, thor_stream
THORChain CLI Tools
thor_cli_bank
Unified banking operations wrapper for Cosmos-SDK bank module.
Actions
| Action | Purpose | Modifies State | Gas Required | Priority |
|---|---|---|---|---|
balances | Query spendable balances | ❌ No | ❌ No | Read-only |
send | Cosmos-SDK bank send | ✅ Yes | ✅ RUNE | State changing |
ensure_funds | Ensure minimum balance | ✅ Conditional | ✅ RUNE | Smart funding |
Technical Details:
- Auto-resolves sender from cached key
- Send supports three formats: amount-only, recipient+amount, full format
- Ensure_funds wraps balance check + send + wait logic
- Requires RUNE for gas fees on all transactions
Examples
thor_cli_bank action="balances"
# Returns: All balances for cached account
thor_cli_bank action="send" args="thor1xyz... 1000rune"
# Sends 1000 RUNE to address
thor_cli_bank action="ensure_funds" address="thor1..." min_balance="100000000rune"
# Funds if balance is below minimum
See Also: thor_api_accounts, thor_faucet_fund
thor_cli_keys
Consolidated key management interface for THORChain wallets.
Actions
| Action | Purpose | Notes |
|---|---|---|
add | Create/import key | Use recover=true to restore from mnemonic |
list | Show all keys | Returns name + address |
show | Inspect key details | Exposes address, public key |
export | Export key material | Supports ASCII armor and hex |
import_hex | Import from hex private key | Non-interactive restore option |
import | Import from armored key file | Requires interactive passphrase |
add (multisig) | Create multisig key | Provide signers via multisig= |
Examples
thor_cli_keys action="add" args="alice"
# Creates key, updates cache DefaultFrom="alice"
thor_cli_keys action="add" args="alice" recover=true
# Prompts for mnemonic
thor_cli_keys action="list"
# Returns: All keys with addresses
thor_cli_keys action="add" args="multisig" multisig="alice,bob,charlie" threshold=2
# Creates 2-of-3 multisig
See Also: thor_api_accounts, thor_cli_tx
thor_cli_tx
Transaction lifecycle management for signing and broadcasting.
Actions
| Action | Purpose | Notes |
|---|---|---|
sign | Sign unsigned transaction file | Supports multisig with account_number/sequence |
broadcast | Submit signed tx (optional wait) | Use wait_timeout_secs for blocking mode |
encode | Encode JSON tx to base64 | Helpful before broadcast when using APIs |
decode | Decode base64/hex tx | Troubleshoot broadcast payloads |
multi_sign | Combine multisig signatures | Requires output JSON from individual signers |
multi_sign_batch | Batch multisig combination | Efficient for multiple txs |
sign_batch | Sign multiple txs sequentially | Useful for scripted workflows |
Examples
thor_cli_tx action="sign" args="/tmp/unsigned.json" from_account="alice"
thor_cli_tx action="broadcast" args="/tmp/signed.json" wait_timeout_secs=60
thor_cli_tx action="encode" args="/tmp/unsigned.json"
# Returns: Base64 protobuf
See Also: thor_cli_keys, thor_api_transactions
thor_cli_memo_tx
High-level wrapper for THORChain-specific memo transactions.
Actions
| Action | Purpose | Command |
|---|---|---|
send | THORChain bespoke send | thornode tx thorchain send |
deposit | Network deposit | thornode tx thorchain deposit |
Examples
thor_cli_memo_tx action="send" args="thor1xyz... 1000000rune"
# Executes with memo support
thor_cli_memo_tx action="deposit" args="1000000rune MEMO:TEXT"
thor_cli_thorchain_mimir
Governance parameter management for THORChain protocol.
Actions
| Action | Purpose | Notes |
|---|---|---|
set | Update a Mimir key | Requires validator/admin privileges |
unset | Remove override for key | Restores default network value |
list | (Planned) inspect overrides | Use thor_api_network action="mimir" today |
Examples
thor_cli_thorchain_mimir action="set" args="MaxSwapsPerBlock 50"
thor_cli_thorchain_mimir action="unset" args="MaxSwapsPerBlock"
See Also: thor_api_network
thor_cli_wasm
Complete CosmWasm contract lifecycle management.
MUST use contract_smart_build before execute action. DO NOT guess execute message formats!
Actions
🌟 Common Actions
| Action | Purpose | Schema Required | Gas Cost | Safety |
|---|---|---|---|---|
deploy | Store + instantiate in one command | Required | High | Safe |
execute | Run contract method | ⚠️ CRITICAL | Varies | Caution |
⚙️ Advanced Actions
| Action | Purpose | Admin Rights | Gas Cost | Use Case |
|---|---|---|---|---|
store | Upload WASM bytecode only | No | High | Manual workflow |
instantiate | Create instance from code ID | No | Medium | Manual workflow |
migrate | Upgrade to new code version | Required | Medium | Contract upgrades |
🔒 Admin Actions
| Action | Purpose | Reversible | Impact |
|---|---|---|---|
set_admin | Transfer admin rights | Yes | Changes who can migrate |
clear_admin | Remove admin permanently | ⚠️ No - Permanent | Makes contract immutable |
🔍 Debug Actions
| Action | Purpose | Returns | Safety |
|---|---|---|---|
download_code | Fetch WASM bytecode | Binary .wasm file | Safe |
query_state_all | Dump all storage keys | Full contract state | Safe |
Technical Constraints:
File Size Limit WASM files must be <800KB. Larger files will fail to upload.
Auto-Upload Behavior Local WASM files are automatically uploaded to containers before execution.
Deploy = Store + Instantiate
The deploy action combines store and instantiate for convenience.
Funds Transfer
Execute action supports sending funds alongside the message via amount parameter.
Migration Permissions
Only the contract admin can perform migrations. Check with thor_api_cosmwasm action="contract_info".
Examples
contract_smart_build user_intent="swap btc for usdc on bow"
# Returns: Contract address + message schema
thor_cli_wasm action="deploy" wasm_file="contract.wasm" instantiate_msg='{"owner":"thor1..."}'
# Returns: Contract address
thor_cli_wasm action="execute" contract="thor1..." execute_msg='{"swap":{...}}' amount="1000000btc"
# Returns: Transaction hash
thor_cli_wasm action="migrate" contract="thor1..." new_code_id=456 migrate_msg='{}'
# Requires admin rights
See Also: contract_smart_build, thor_api_cosmwasm
Monitoring & Health Tools
thor_stream
Real-time streaming and transaction waiting for THORChain.
Actions
| Action | Purpose | Notes |
|---|---|---|
wait_for | Block until a tx hash confirms | Supports timeout via timeout_ms |
new_blocks | Stream new block headers | Real-time monitoring |
contract_events | Stream events from contract | Filter by contract and optional action |
subscribe | Raw websocket subscription | Provide custom Tendermint query |
Examples
thor_stream action="wait_for" tx_hash="ABC123..." timeout_ms=30000
# Waits up to 30 seconds
thor_stream action="new_blocks" timeout_ms=60000
# Streams blocks for 60 seconds
thor_stream action="contract_events" contract="thor1..." timeout_ms=60000
See Also: thor_api_transactions, thor_cli_tx
thor_health
THORChain network health probe and status monitoring.
Actions
Composite Check (action=check)
Runs all health probes in parallel:
- Tendermint RPC - Node sync status
- Router Endpoints - Inbound address availability
- Queue Status - Swap/outbound processing
- Mimir Configuration - Governance parameters loaded
- Node-Set Health - Validator participation
Returns detailed JSON with pass/fail for each subsystem.
Readiness (action=ready)
Simplified boolean health check:
{
"ready": true,
"message": "All systems operational"
}
Use in automation:
if thor_health action="ready" | jq -r '.ready' == "true"; then
echo "Network is ready"
fi
Tendermint (action=tm)
Returns core consensus metrics:
latest_block_height- Current chain heightlatest_block_time- Block timestampcatching_up- Sync status (true/false)validator_info- Validator pub key and voting power
Node-Set (action=nodes)
Identifies validator issues:
- Missing blocks - Validators not producing
- Health percentages - Participation rates
- Warning thresholds - Configurable alerts
| Action | Scope | Response Detail | Speed | Best For |
|---|---|---|---|---|
ready | Summary | ✅/❌ Boolean + message | Fastest | CI/CD health gates |
check | Composite | Full subsystem breakdown | Medium | Default - comprehensive debugging |
tm | Tendermint only | Height, time, catching_up | Fast | Quick sync status |
nodes | Node-set | Validator health + missing blocks | Medium | Validator monitoring |
Health Check Components:
Examples
thor_health action="ready"
# Returns: Ready/not-ready status
thor_health action="check"
# Returns: Detailed health across all subsystems
thor_health action="tm"
# Returns: Height, time, catching_up
See Also: thor_service_restart
setup_health
Dependency verification for Docker and Kurtosis.
Actions
| Probe | Purpose | Notes |
|---|---|---|
| Docker | Validates Docker daemon availability | Checks docker version |
| Kurtosis | Ensures Kurtosis CLI/engine reachable | Runs kurtosis engine status |
| Cache | Reports cached context freshness | Warns if older than 24h |
Examples
setup_health
# Returns pass/fail for Docker and Kurtosis
See Also: thor_health
Schema & Discovery Tools
contract_schema_list
Enumerate available contract schemas bundled with MCP server.
Actions
| Action | Purpose | Notes |
|---|---|---|
list | Return embedded schema filenames | Helpful before inspecting a specific schema |
Examples
contract_schema_list
# Returns: ["rujira-bow.json", "rujira-fin.json", ...]
See Also: contract_schema_info
contract_schema_info
Inspect function-level schema details for contracts.
Actions
| Parameter | Purpose | Notes |
|---|---|---|
schema_file | Path returned from contract_schema_list | Required |
function | Function name (instantiate, execute, query) | Required |
format | Optional output mode (json or markdown) | Defaults to structured text |
Returns function signature, required fields, and type information.
Examples
contract_schema_info schema_file="schema/rujira-bow.json" function="instantiate"
# Shows required fields and types
See Also: contract_smart_build
contract_smart_build
PRIMARY SCHEMA DISCOVERY TOOL - Build contract messages from natural language.
Actions
| Parameter | Purpose | Notes |
|---|---|---|
user_intent | Natural language description of desired action | Required |
context | Optional JSON with additional hints | Rarely needed |
network | Override active context | Defaults to cached context |
Returns contract address, execute/query type, and fully formed message JSON.
This is the most critical tool for contract interaction. Always use it before executing or querying contracts!
Examples
contract_smart_build user_intent="swap btc for usdc on fin"
# Returns: {"contract": "thor1...", "msg": {"swap": {}}}
contract_smart_build user_intent="quote 1 btc to usdc on bow"
# Returns: Query message for price quote
contract_smart_build user_intent="get pool from bow"
# Returns: {"contract": "thor1...", "msg": {"get_pool_state": {}}}
See Also: thor_cli_wasm, thor_api_cosmwasm
cosmwasm_contract_find
Intelligent contract address lookup using natural language.
Actions
| Parameter | Purpose | Notes |
|---|---|---|
query | Natural language description of desired contract | Required |
network | Optional network override | Defaults to cached context |
Automatically extracts token symbols and maps keywords (pool, swap, perp, staking) to supported contract families.
Only finds Rujira/Levana/Nami contracts, NOT generic CW20/CW721.
Examples
cosmwasm_contract_find query="eth usdc pool"
# Returns: Bow pool address for ETH/USDC
cosmwasm_contract_find query="rujira fin btc rune"
# Returns: Fin orderbook for BTC/RUNE
cosmwasm_contract_find query="rujira staking"
# Returns: Staking contract address
See Also: contract_smart_build