get-address-utxo
Retrieve unspent transaction outputs (UTXOs) for a Bitcoin address to check available funds and transaction history.
Instructions
Returns UTXOs for an address
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | The address to get UTXOs for |
Implementation Reference
- src/interface/controllers/AddressToolsController.ts:75-87 (registration)Registers the 'get-address-utxo' MCP tool with server, including input schema and execution handler.private registerGetAddressUtxoHandler(): void { this.server.tool( "get-address-utxo", "Returns UTXOs for an address", { address: z.string().describe("The address to get UTXOs for"), }, async ({ address }) => { const text = await this.addressService.getAddressUtxo({ address }); return { content: [{ type: "text", text }] }; } ); }
- Core handler implementation: performs the API request to retrieve UTXOs for the address.async getAddressUtxo({ address }: { address: string }): Promise<IAddressUtxoResponse[] | null> { return this.client.makeRequest<IAddressUtxoResponse[]>(`address/${address}/utxo`); }
- Helper service method that fetches UTXOs and formats the response.async getAddressUtxo({ address }: IAddressParameter): Promise<string> { const data = await this.requestService.getAddressUtxo({ address }); return formatResponse<IAddressUtxoResponse[]>("Address UTXOs", data); }
- Type definition for the UTXO response structure used in the tool.export interface IAddressUtxoResponse { txid: string; vout: number; value: number; status: { confirmed: boolean; block_height?: number; block_hash?: string; block_time?: number; }; }