# Module BSV::MCP::Tools::Helpers <a id="module-BSV-MCP-Tools-Helpers"></a>

Shared helpers used across multiple MCP tools.

## Public Class Methods
### `error_response(message)` <a id="method-c-error_response"></a> <a id="error_response-class_method"></a>
Build a standard MCP error response.
- **@param** `message` [String] error description
- **@return** [MCP::Tool::Response]

### `input_to_h(input, _index)` <a id="method-c-input_to_h"></a> <a id="input_to_h-class_method"></a>
Convert a Transaction::TransactionInput to a hash.
- **@api** private

### `output_to_h(output, index)` <a id="method-c-output_to_h"></a> <a id="output_to_h-class_method"></a>
Convert a Transaction::TransactionOutput to a hash.
- **@api** private

### `resolve_network_sym(network_arg, server_context)` <a id="method-c-resolve_network_sym"></a> <a id="resolve_network_sym-class_method"></a>
Resolve a network string to the SDK symbol (:mainnet or :testnet).

Checks the per-call `network_arg` first, then falls back to the server-level
config in `server_context`, then defaults to :mainnet.
- **@param** `network_arg` [String, nil] per-call override ('mainnet'/'testnet')
- **@param** `server_context` [Hash, nil] server context with :bsv_network key
- **@return** [Symbol] :mainnet or :testnet

### `transaction_to_h(tx)` <a id="method-c-transaction_to_h"></a> <a id="transaction_to_h-class_method"></a>
Convert a Transaction to a hash suitable for JSON responses.
- **@param** `tx` [Transaction::Tx]
- **@return** [Hash]

### `utxo_to_h(utxo)` <a id="method-c-utxo_to_h"></a> <a id="utxo_to_h-class_method"></a>
Convert a UTXO to a hash.
- **@api** private
