get-mempool-txids
Retrieve transaction IDs from the Bitcoin mempool to monitor pending transactions and analyze network activity in real-time.
Instructions
Returns mempool txids
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/interface/controllers/MempoolToolsController.ts:27-36 (registration)Registers the 'get-mempool-txids' MCP tool, which invokes MempoolService.getMempoolTxids() and returns the result as text content.private registerGetMempoolTxidsHandler(): void { this.server.tool( "get-mempool-txids", "Returns mempool txids", async () => { const text = await this.mempoolService.getMempoolTxids(); return { content: [{ type: "text", text }] }; } ); }
- Executes the core tool logic by making an API request to the '/mempool/txids' endpoint via IApiClient.async getMempoolTxids(): Promise<IMempoolTxidResponse[] | null> { return this.client.makeRequest<IMempoolTxidResponse[]>(`mempool/txids`); }
- Wrapper that fetches mempool txids from the request service and formats them into a string response using formatResponse.async getMempoolTxids(): Promise<string> { const data = await this.requestService.getMempoolTxids(); return formatResponse<IMempoolTxidResponse[]>("Mempool Txids", data); }
- Defines TypeScript interfaces and types for mempool API responses, including IMempoolTxidResponse as string for txids.export interface IMempoolInfoResponse { count: number; vsize: number; total_fee: number; } export type IMempoolTxidResponse = string; export interface IMempoolRecentResponse { txid: string; fee: number; vsize: number; value: number; time: number; }