analyze_transaction
Decode and analyze Bitcoin transactions to examine inputs, outputs, fee rates, SegWit/Taproot flags, and detect inscriptions using a transaction hash.
Instructions
Decode and analyze a transaction: inputs, outputs, fee rate, SegWit/Taproot flags, inscription detection.
Args: txid: Transaction hash (64 hex characters). Local nodes need txindex=1 for confirmed txs; the hosted API handles this automatically.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| txid | Yes |
Output Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/bitcoin_mcp/server.py:357-364 (handler)The `analyze_transaction` tool handler in `src/bitcoin_mcp/server.py`, which delegates the logic to the `_analyze_transaction` function imported from `bitcoinlib_rpc.transactions`.
def analyze_transaction(txid: str) -> str: """Decode and analyze a transaction: inputs, outputs, fee rate, SegWit/Taproot flags, inscription detection. Args: txid: Transaction hash (64 hex characters). Local nodes need txindex=1 for confirmed txs; the hosted API handles this automatically. """ analysis = _analyze_transaction(get_rpc(), txid) return analysis.model_dump_json()