Skip to main content
Glama
alexandresanlim

Mempool MCP Server

get-tx-info

Retrieve detailed information about a Bitcoin transaction using its txid with Mempool MCP Server, enabling precise blockchain data access for analysis or verification.

Instructions

Returns details about a transaction

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
txidYesThe txid to get info for

Implementation Reference

  • Registration of the 'get-tx-info' MCP tool including input schema (zod for txid), description, and thin handler function that calls TxService.getTxInfo and returns formatted text content.
    private registerGetTxHandler(): void { this.server.tool( "get-tx-info", "Returns details about a transaction", { txid: z.string().length(64).describe("The txid to get info for"), }, async ({ txid }) => { const text = await this.txService.getTxInfo({ txid }); return { content: [{ type: "text", text }] }; } ); }
  • Core handler logic for fetching and formatting transaction info using request service and formatResponse helper.
    async getTxInfo({ txid }: { txid: string }): Promise<string> { const data = await this.requestService.getTxInfo({ txid }); return formatResponse<ITxResponse>("Transaction Info", data); }
  • Type definition (schema) for the transaction info response data structure.
    export interface ITxResponse { txid: string; version: number; locktime: number; vin: any[]; vout: any[]; size: number; weight: number; fee: number; status: ITxStatusResponse; }
  • Low-level helper that performs the actual API request to retrieve raw transaction info for the given txid.
    async getTxInfo({ txid }: { txid: string }): Promise<ITxResponse | null> { return this.client.makeRequest<ITxResponse>(`tx/${txid}`); }

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