Skip to main content

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

ToolPurposeKey Actions
kurtosis_enclaveManage test network environmentsls, inspect, rm, connect, dump
kurtosis_serviceManage individual serviceslogs, exec, shell, start, stop
kurtosis_filesFile and artifact managementupload, download, import_web
kurtosis_systemSystem-level engine managementclean, engine_status, github_login

Common operations

StepCommandPurpose
1kurtosis_enclave action="ls"View active/stopped enclaves
2kurtosis_service action="logs" service="thornode"Inspect service logs
3kurtosis_system action="clean"Remove stopped enclaves and images

See detailed actions

🌐 Network Lifecycle Tools – Deployment, context, and state management

Use these tools to launch THORChain, keep state healthy, and fund development accounts.

Tools

ToolPriorityPurpose
kurtosis_thorchain_up⚠️ Required firstNetwork bootstrapper
thor_contextHighContext and cache management
thor_service_restartMediumService restart strategies
thor_state_snapshotMediumDevelopment checkpoints
thor_defaults_refreshAdvancedRuntime configuration updates
thor_faucet_fundDaily useDevelopment account funding

Essential commands

CommandReturnsUse case
kurtosis_thorchain_upEnclave ID + endpointsLaunch a new network
thor_context action="resolve"Current context detailsConfirm active network
thor_faucet_fund to_address="thor1..." amount="100000000" denom="rune"Transaction hashFund an account

See detailed actions

📊 THORChain API Tools – Read-only blockchain queries

Read-only API clients for inspecting accounts, contracts, pools, and network state without changing chain data.

Tools

ToolQueriesGas cost
thor_api_accountsAccount metadata, balancesNone
thor_api_cosmwasmSmart contract stateNone
thor_api_liquidityPool data, inbound addressesNone
thor_api_networkNetwork stats, Mimir, blocksNone
thor_api_transactionsTransaction details, searchNone

Common queries

GoalCommandReturns
Check balancethor_api_accounts action="balances"All balances
Query contractthor_api_cosmwasm action="query" address="thor1..." query='{...}'Contract state
Get network statsthor_api_network action="network"Bond and liquidity metrics

See detailed actions

⚡ THORChain CLI Tools – Transaction execution and account management

CLI wrappers for sending transactions, managing keys, and handling CosmWasm deployments.

Tools

ToolPurposeModifies state
thor_cli_bankBanking operations (send tokens)
thor_cli_keysKey management❌ (local)
thor_cli_txTransaction signing/broadcasting
thor_cli_memo_txTHORChain-specific memos
thor_cli_thorchain_mimirGovernance parameters
thor_cli_wasmCosmWasm contract lifecycle

Essential operations

OperationCommandImpact
Create keythor_cli_keys action="add" args="mykey"Adds key to local keyring
Send tokensthor_cli_bank action="send" args="thor1... 1000rune"Broadcasts bank send
Deploy contractthor_cli_wasm action="deploy" wasm_file="contract.wasm" instantiate_msg='{...}'Stores and instantiates contract

See detailed actions

🔍 Monitoring & Health Tools – Real-time monitoring and health checks

Monitor network health, dependency readiness, and transaction progress.

Tools

ToolReal-timePurpose
thor_streamEvent streaming and transaction waits
thor_healthNode and subsystem health probes
setup_healthDocker/Kurtosis dependency check

Monitoring commands

CommandTypeUse case
thor_health action="ready"SnapshotCI/CD readiness gate
thor_stream action="wait_for" tx_hash="ABC123..."Real-timeWait for a transaction
setup_healthSnapshotVerify local prerequisites

See detailed actions

🔬 Schema & Discovery Tools – Contract interface discovery

Discover available schemas, translate natural-language intents, and locate supported contracts.

Tools

ToolInputOutputCritical
contract_schema_listNoneEmbedded schema namesNo
contract_schema_infoSchema file + functionFunction signatureNo
contract_smart_buildNatural language intentComplete message + address🌟 Required
cosmwasm_contract_findNatural language queryContract addressNo

Schema workflow

StepCommandReturns
1contract_smart_build user_intent="swap btc for usdc on fin"Contract + message
2cosmwasm_contract_find query="eth usdc pool"Matching contract address

See detailed actions

Detailed Tool Reference

Kurtosis Management Tools

kurtosis_enclave

Primary interface for managing Kurtosis enclaves (isolated test network environments).

Actions
ActionPurposeParametersImpact
lsList all enclavesNoneSafe
inspectGet detailed infoenclave (optional)Safe
rmRemove enclaveenclave, force (optional)Destructive
connectPort forwardenclave, service, portsNetwork
dumpExport stateenclaveSafe
addCreate empty enclaveenclaveCreates Resources
stopStop enclaveenclaveStops Services
Technical Details
  • Auto-detects enclave names containing "thor"
  • Supports custom enclave names via the enclave parameter
  • Returns structured JSON for inspection operations
Examples
List all enclaves
kurtosis_enclave action="ls"
# Returns: ["thorchain-test", "my-network"]
Inspect specific enclave
kurtosis_enclave action="inspect" enclave="thorchain-test"
# Returns: Services, ports, UUID, creation time
Remove enclave (force if running)
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

ActionPurposeKey ParametersSafety
logsView service logsnum, follow, filterSafe
execExecute commandcommand (required), userCaution
shellInteractive shellshell (default: /bin/sh)Caution
inspectService detailsFormat: JSON/YAMLSafe

⚙️ Lifecycle Actions

ActionPurposeImpact
startStart stopped serviceModifies State
stopStop running serviceService Unavailable
updateUpdate configurationConfig Changes
rmRemove servicePermanent Deletion
Technical Details
  • Log filtering supports match, regex, and inversion
  • Exec commands run as root by default (customizable with user parameter)
  • Service inspection returns JSON/YAML format
Examples
View recent logs
kurtosis_service action="logs" enclave="thorchain-test" service="thornode" num=100
# Returns: Last 100 log lines
Execute command in container
kurtosis_service action="exec" enclave="thorchain-test" service="thornode" command="ls -la /root"
Follow logs in real-time
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
ActionPurposeSource/TargetPersists
uploadUpload local filesLocal filesystem → Enclave✅ Yes
downloadDownload artifactEnclave → Local filesystemN/A
inspectView artifact contentsEnclave artifactN/A
import_webImport from URLHTTP/HTTPS → Enclave✅ Yes
render_templateRender Go templatesTemplate + JSON data✅ Yes
store_serviceCapture service fileService file → Artifact✅ Yes
Technical Details
  • Artifacts persist across service restarts
  • Supports directory uploads (recursive)
  • Web imports support tar.gz, zip, and raw files
Examples
Upload configuration
kurtosis_files action="upload" enclave="thorchain-test" artifacts_source="/local/config.json"
Download logs
kurtosis_files action="download" enclave="thorchain-test" artifact_identifier="app-logs"
Import from URL
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

ActionPurposeImpact
engine_startStart Kurtosis engineEngine Becomes Active
engine_stopStop engine gracefullyAll Enclaves Stop
engine_restartRestart with new settingsBrief Downtime
engine_statusCheck health & versionRead-Only
engine_logsExport logsRead-Only

🗑️ Cleanup

ActionScopeDisk Space Freed
cleanStopped enclaves onlyModerate
clean all=true⚠️ ALL enclavesMaximum
Clean Command Caution

clean removes only stopped enclaves by default. Using clean all=true removes ALL enclaves including running ones!

🔐 GitHub Auth

ActionPurposeRequired For
github_loginAuthenticate with GitHubPrivate repos
github_logoutRemove authenticationSecurity
github_statusCheck auth statusVerification
Technical Details
  • Engine control affects all running enclaves
  • Clean command removes stopped enclaves by default (use all=true for running enclaves)
  • GitHub authentication persists across engine restarts
Examples
Clean up stopped enclaves
kurtosis_system action="clean"
# Frees disk space
Check engine status
kurtosis_system action="engine_status"
# Returns: Version, status, uptime
Authenticate with GitHub
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.

Required First Step

MUST be called before any thor_cli_* or thor_api_* operations.

Actions
ParameterDefaultPurpose
enable_forkingtrueLaunch from forked mainnet vs. fresh devnet
block_height23000000Fork height when forking mainnet
enclaveauto-generatedName for the Kurtosis enclave
args_fileYAML 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
Launch forked mainnet (default)
kurtosis_thorchain_up enclave="thorchain-test"
# Launches at block 23,000,000
# Ready in ~2 minutes
Launch fresh devnet
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
ActionModeAuto-detectUpdates cacheReturns
resolveRead-only✅ Yes❌ NoFull context object with endpoints
useModifies state❌ No (explicit selection)✅ YesConfirmation with cached endpoints

💾 Cache Fields

FieldTypePriorityPurpose
EnclavestringRequiredActive environment identifier
ServicestringRequiredTHORChain service name (e.g., thornode-node-1)
APIAddressURLRequiredREST API endpoint for HTTP queries
RPCAddressURLImportantCometBFT RPC endpoint for consensus queries
WSAddressWebSocketImportantWebSocket endpoint for event streaming
ServicePortsDictionaryOptionalPort mapping for all exposed services
Auto-Detection Priority

THORChain-named enclaves → first available → mainnet fallback

Examples
Resolve current context
thor_context action="resolve"
# Returns: {"enclave": "thorchain-test", "service": "thornode-node-1", ...}
Switch to different network
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
ModePurposeTypical Use
singleRestart one service and wait for health confirmationApply config changes to a single component
rollingRestart services sequentially based on selectorUpgrade multiple thornode/bifrost instances safely
healthRestart only services failing health checksAutomated recovery workflows

Parameters

  • service: Explicit service name (for single mode)
  • selector: Wildcard to match multiple services (for rolling mode)
  • services: Comma-separated list evaluated for health (for health mode)
  • wait_ready_timeout: Seconds to wait for health checks (default 60)
Examples
Restart single service
thor_service_restart mode="single" service="thornode"
Rolling restart
thor_service_restart mode="rolling" selector="thornode*"
Restart only unhealthy services
thor_service_restart mode="health" services="thornode,midgard,faucet"

See Also: thor_health

thor_state_snapshot

Development state checkpoint creation for THORChain networks.

Actions
ActionScopeIncludesTypical Size
captureminConfiguration files only~2 MB
capturenodeConfig + thornode data + WASM contracts~500 MB
capturefullNode 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
Create node snapshot (recommended)
thor_state_snapshot name="contracts-deployed" scope="node"
# Captures blockchain state with contracts (~500 MB)
Create minimal snapshot
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
ActionPurposeBehavior
refreshMerge updated thorchain_defaults.json into thornodeUploads 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
Refresh thornode defaults
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
ParameterPurposeNotes
to_addressRecipient THORChain addressMust be bech32 (thor1...)
amountAmount in base unitsOptional when using presets
denomAsset to request (e.g., rune, btc, btc/btc)Defaults to rune
thornode_apiCustom API endpointOverrides cached context

Supports secured assets (btc), trade assets (btc~btc), and synthetic assets (btc/btc).

Examples
Fund with RUNE
thor_faucet_fund to_address="thor1abc..." amount="100000000" denom="rune"
# Funds with 100 RUNE
Fund with BTC (secured asset)
thor_faucet_fund to_address="thor1abc..." amount="100000000" denom="btc"
# Funds with 1 BTC secured asset
Fund with synthetic BTC
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
ActionPurposePriorityReturns
accountGet TX signing metadataRequired for TXaccount_number, sequence, pub_key
balancesCheck all balancesPre-TX verificationAll denominations with amounts
spendableAvailable balances onlyOptional filterUnlocked balances

Technical Details:

  • Address parameter defaults to cached key (most recently used)
  • Supports explicit address override
  • Balance queries support denom filtering
Examples
Query balances (uses cached key)
thor_api_accounts action="balances"
# Returns: All balances for cached account
Get account metadata for signing
thor_api_accounts action="account" address="thor1xyz..."
# Returns: account_number, sequence, pub_key
Check specific denomination
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.

Critical Warning

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

ActionPrioritySchema NeededUse Case
query🔴 CriticalYESRead contract state
Schema Discovery Required

ALWAYS run contract_smart_build before using query. The schema must match exactly or you'll get HTTP 500 errors.

📄 Metadata

ActionPurposeSchemaReturns
contract_infoGet contract metadataNocode_id, creator, admin, label
code_infoGet code metadataNopermissions, checksum
codesList all WASM codesNoArray of code IDs

🔎 Search

ActionPurposeFiltersSchema
findSearch contractscode_id, label, creatorNo
contracts_by_codeList instances of code IDcode_id (required)No
Technical Details
  • Query requires discovered schema from contract_smart_build
  • Supports pagination for list operations
  • Code info includes instantiate permissions
Examples
Complete query workflow
# 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":{}}'
Get contract info
thor_api_cosmwasm action="contract_info" address="thor1..."
Find contracts by code ID
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
ActionPurposeParametersPriority
listGet pool summariesNoneDiscovery
snapshotDetailed pool infoasset (e.g., BTC.BTC)Pool details
inbound_forGet inbound addresschain_or_assetCross-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
List all pools
thor_api_liquidity action="list"
# Returns: All pools with depths and status
Get detailed pool snapshot
thor_api_liquidity action="snapshot" asset="BTC.BTC"
# Returns: Detailed BTC pool statistics
Get inbound address for chain
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
ActionPurposeNotes
networkHigh-level liquidity and bond metricsDefault view for dashboards
mimirGovernance parameter dumpIncludes 200+ configuration keys
queueSwap / outbound queue statusUseful for debugging congestion
blockFetch block data (pass height)Returns header + tx hashes
constantsCurrent THORChain constantsMirrors on-chain constant values
versionThornode version infoHelpful for verifying upgrades
pool_snapshot(Deprecated) use thor_api_liquidityProvided for completeness
Examples
Get Mimir configuration
thor_api_network action="mimir"
# Returns: All governance parameters
Check transaction queue
thor_api_network action="queue"
# Returns: Swap/outbound/internal counts
Get network statistics
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
ActionPurposeNotes
getFetch transaction by hashReturns full decoded result
searchTendermint event searchRequires indexed events (set query)
waitWait for tx hash to confirmPolls until included or timeout
simulateEstimate gas from tx bytesUse before broadcasting custom tx
Examples
Get transaction by hash
thor_api_transactions action="get" hash="64CA86308E06FE2CEF7DBF3F4D5EF38C06FF42FB3FA35119CEA38D21814D25FB"
# Returns: Full transaction details with events
Search transactions (requires indexer)
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
ActionPurposeModifies StateGas RequiredPriority
balancesQuery spendable balances❌ No❌ NoRead-only
sendCosmos-SDK bank send✅ Yes✅ RUNEState changing
ensure_fundsEnsure minimum balance✅ Conditional✅ RUNESmart 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
Check balances
thor_cli_bank action="balances"
# Returns: All balances for cached account
Send tokens
thor_cli_bank action="send" args="thor1xyz... 1000rune"
# Sends 1000 RUNE to address
Ensure minimum balance
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
ActionPurposeNotes
addCreate/import keyUse recover=true to restore from mnemonic
listShow all keysReturns name + address
showInspect key detailsExposes address, public key
exportExport key materialSupports ASCII armor and hex
import_hexImport from hex private keyNon-interactive restore option
importImport from armored key fileRequires interactive passphrase
add (multisig)Create multisig keyProvide signers via multisig=
Examples
Create new key
thor_cli_keys action="add" args="alice"
# Creates key, updates cache DefaultFrom="alice"
Recover key from mnemonic
thor_cli_keys action="add" args="alice" recover=true
# Prompts for mnemonic
List all keys
thor_cli_keys action="list"
# Returns: All keys with addresses
Create multisig key
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
ActionPurposeNotes
signSign unsigned transaction fileSupports multisig with account_number/sequence
broadcastSubmit signed tx (optional wait)Use wait_timeout_secs for blocking mode
encodeEncode JSON tx to base64Helpful before broadcast when using APIs
decodeDecode base64/hex txTroubleshoot broadcast payloads
multi_signCombine multisig signaturesRequires output JSON from individual signers
multi_sign_batchBatch multisig combinationEfficient for multiple txs
sign_batchSign multiple txs sequentiallyUseful for scripted workflows
Examples
Sign transaction
thor_cli_tx action="sign" args="/tmp/unsigned.json" from_account="alice"
Broadcast and wait for confirmation
thor_cli_tx action="broadcast" args="/tmp/signed.json" wait_timeout_secs=60
Encode transaction
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
ActionPurposeCommand
sendTHORChain bespoke sendthornode tx thorchain send
depositNetwork depositthornode tx thorchain deposit
Examples
THORChain send with memo
thor_cli_memo_tx action="send" args="thor1xyz... 1000000rune"
# Executes with memo support
Network deposit
thor_cli_memo_tx action="deposit" args="1000000rune MEMO:TEXT"

thor_cli_thorchain_mimir

Governance parameter management for THORChain protocol.

Actions
ActionPurposeNotes
setUpdate a Mimir keyRequires validator/admin privileges
unsetRemove override for keyRestores default network value
list(Planned) inspect overridesUse thor_api_network action="mimir" today
Examples
Set governance parameter
thor_cli_thorchain_mimir action="set" args="MaxSwapsPerBlock 50"
Remove override
thor_cli_thorchain_mimir action="unset" args="MaxSwapsPerBlock"

See Also: thor_api_network

thor_cli_wasm

Complete CosmWasm contract lifecycle management.

Critical Requirement

MUST use contract_smart_build before execute action. DO NOT guess execute message formats!

Actions

🌟 Common Actions

ActionPurposeSchema RequiredGas CostSafety
deployStore + instantiate in one commandRequiredHighSafe
executeRun contract method⚠️ CRITICALVariesCaution

⚙️ Advanced Actions

ActionPurposeAdmin RightsGas CostUse Case
storeUpload WASM bytecode onlyNoHighManual workflow
instantiateCreate instance from code IDNoMediumManual workflow
migrateUpgrade to new code versionRequiredMediumContract upgrades

🔒 Admin Actions

ActionPurposeReversibleImpact
set_adminTransfer admin rightsYesChanges who can migrate
clear_adminRemove admin permanently⚠️ No - PermanentMakes contract immutable

🔍 Debug Actions

ActionPurposeReturnsSafety
download_codeFetch WASM bytecodeBinary .wasm fileSafe
query_state_allDump all storage keysFull contract stateSafe

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
Step 1: Build message with schema
contract_smart_build user_intent="swap btc for usdc on bow"
# Returns: Contract address + message schema
Step 2: Deploy contract
thor_cli_wasm action="deploy" wasm_file="contract.wasm" instantiate_msg='{"owner":"thor1..."}'
# Returns: Contract address
Step 3: Execute contract method
thor_cli_wasm action="execute" contract="thor1..." execute_msg='{"swap":{...}}' amount="1000000btc"
# Returns: Transaction hash
Migrate contract (admin only)
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
ActionPurposeNotes
wait_forBlock until a tx hash confirmsSupports timeout via timeout_ms
new_blocksStream new block headersReal-time monitoring
contract_eventsStream events from contractFilter by contract and optional action
subscribeRaw websocket subscriptionProvide custom Tendermint query
Examples
Wait for transaction confirmation
thor_stream action="wait_for" tx_hash="ABC123..." timeout_ms=30000
# Waits up to 30 seconds
Stream new blocks
thor_stream action="new_blocks" timeout_ms=60000
# Streams blocks for 60 seconds
Monitor contract events
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 height
  • latest_block_time - Block timestamp
  • catching_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
ActionScopeResponse DetailSpeedBest For
readySummary✅/❌ Boolean + messageFastestCI/CD health gates
checkCompositeFull subsystem breakdownMediumDefault - comprehensive debugging
tmTendermint onlyHeight, time, catching_upFastQuick sync status
nodesNode-setValidator health + missing blocksMediumValidator monitoring

Health Check Components:

Examples
Quick readiness check
thor_health action="ready"
# Returns: Ready/not-ready status
Full health check
thor_health action="check"
# Returns: Detailed health across all subsystems
Tendermint status only
thor_health action="tm"
# Returns: Height, time, catching_up

See Also: thor_service_restart

setup_health

Dependency verification for Docker and Kurtosis.

Actions
ProbePurposeNotes
DockerValidates Docker daemon availabilityChecks docker version
KurtosisEnsures Kurtosis CLI/engine reachableRuns kurtosis engine status
CacheReports cached context freshnessWarns if older than 24h
Examples
Check local prerequisites
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
ActionPurposeNotes
listReturn embedded schema filenamesHelpful before inspecting a specific schema
Examples
List available schemas
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
ParameterPurposeNotes
schema_filePath returned from contract_schema_listRequired
functionFunction name (instantiate, execute, query)Required
formatOptional output mode (json or markdown)Defaults to structured text

Returns function signature, required fields, and type information.

Examples
Inspect instantiate message
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
ParameterPurposeNotes
user_intentNatural language description of desired actionRequired
contextOptional JSON with additional hintsRarely needed
networkOverride active contextDefaults to cached context

Returns contract address, execute/query type, and fully formed message JSON.

Most Important Tool

This is the most critical tool for contract interaction. Always use it before executing or querying contracts!

Examples
Build swap message
contract_smart_build user_intent="swap btc for usdc on fin"
# Returns: {"contract": "thor1...", "msg": {"swap": {}}}
Build query message
contract_smart_build user_intent="quote 1 btc to usdc on bow"
# Returns: Query message for price quote
Build pool query
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
ParameterPurposeNotes
queryNatural language description of desired contractRequired
networkOptional network overrideDefaults to cached context

Automatically extracts token symbols and maps keywords (pool, swap, perp, staking) to supported contract families.

Specialized Tool

Only finds Rujira/Levana/Nami contracts, NOT generic CW20/CW721.

Examples
Find pool contract
cosmwasm_contract_find query="eth usdc pool"
# Returns: Bow pool address for ETH/USDC
Find orderbook
cosmwasm_contract_find query="rujira fin btc rune"
# Returns: Fin orderbook for BTC/RUNE
Find staking contract
cosmwasm_contract_find query="rujira staking"
# Returns: Staking contract address

See Also: contract_smart_build