get-address-txs-mempool
Retrieve pending Bitcoin transactions for a specific address in the mempool. This tool enables users to access real-time unconfirmed transactions, providing insights into Bitcoin network activity.
Instructions
Returns mempool transactions for an address
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | The address to get mempool txs for |
Implementation Reference
- Core handler function that executes the tool logic by making an API request to the endpoint `address/${address}/txs/mempool` to fetch mempool transactions for the address.async getAddressTxsMempool({ address }: { address: string }): Promise<IAddressTxResponse[] | null> { return this.client.makeRequest<IAddressTxResponse[]>(`address/${address}/txs/mempool`); }
- TypeScript interface defining the structure of address transaction responses (output schema for the tool).export interface IAddressTxResponse { txid: string; status: { confirmed: boolean; block_height?: number; block_hash?: string; block_time?: number; }; vin: any[]; vout: any[]; }
- src/interface/controllers/AddressToolsController.ts:61-73 (registration)Registers the 'get-address-txs-mempool' MCP tool with input schema (zod string address) and a handler that delegates to AddressService.private registerGetAddressTxsMempoolHandler(): void { this.server.tool( "get-address-txs-mempool", "Returns mempool transactions for an address", { address: z.string().describe("The address to get mempool txs for"), }, async ({ address }) => { const text = await this.addressService.getAddressTxsMempool({ address }); return { content: [{ type: "text", text }] }; } ); }
- Helper service method that calls the request service and formats the response using formatResponse.async getAddressTxsMempool({ address }: IAddressParameter): Promise<string> { const data = await this.requestService.getAddressTxsMempool({ address }); return formatResponse<IAddressTxResponse[]>( "Address Mempool Transactions", data ); }