Skip to main content
Glama
alexandresanlim

Mempool MCP Server

get-tx-status

Check Bitcoin transaction status by providing a transaction ID to verify confirmation and network state.

Instructions

Returns status for a transaction

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
txidYesThe txid to get status for

Implementation Reference

  • Registers the MCP 'get-tx-status' tool: defines description, input schema (txid: 64-hex string), and handler lambda that delegates to TxService.getTxStatus and structures MCP response.
    private registerGetTxStatusHandler(): void { this.server.tool( "get-tx-status", "Returns status for a transaction", { txid: z.string().length(64).describe("The txid to get status for"), }, async ({ txid }) => { const text = await this.txService.getTxStatus({ txid }); return { content: [{ type: "text", text }] }; } ); }
  • Core handler logic in TxRequestService: performs the actual API request to `/tx/${txid}/status` via IApiClient.makeRequest, typed to ITxStatusResponse.
    async getTxStatus({ txid }: { txid: string }): Promise<ITxStatusResponse | null> { return this.client.makeRequest<ITxStatusResponse>(`tx/${txid}/status`); }
  • Intermediate service layer: calls TxRequestService.getTxStatus and formats the response into a string using formatResponse.
    async getTxStatus({ txid }: { txid: string }): Promise<string> { const data = await this.requestService.getTxStatus({ txid }); return formatResponse<ITxStatusResponse>("Transaction Status", data); }
  • TypeScript interface defining the structure of the transaction status response used throughout the implementation.
    export interface ITxStatusResponse { confirmed: boolean; block_height?: number; block_hash?: string; block_time?: number; }
  • Utility function to format response objects into readable key-value strings, used in TxService.
    export const formatResponse = <T extends object>( title: string, data: T | null ): string => { if (!data) { return `Failed to retrieve ${title.toLowerCase()} data.`; } let msg = `${title}:\n`; for (const [key, value] of Object.entries(data)) { msg += `${key}: ${value ?? "N/A"}\n`; } return msg.trim(); };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/alexandresanlim/mempool-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server