Skip to main content
Glama
alexandresanlim

Mempool MCP Server

get-tx-info

Retrieve transaction details from the Bitcoin blockchain by providing a transaction ID, enabling users to access specific transaction information through the Mempool MCP Server.

Instructions

Returns details about a transaction

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
txidYesThe txid to get info for

Implementation Reference

  • Registers the MCP tool 'get-tx-info' with input schema for txid (64-char string), description, and handler that fetches from TxService and returns 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 }] };
        }
      );
    }
  • Application service layer: Retrieves transaction info via request service and formats it using formatResponse.
    async getTxInfo({ txid }: { txid: string }): Promise<string> {
      const data = await this.requestService.getTxInfo({ txid });
      return formatResponse<ITxResponse>("Transaction Info", data);
    }
  • Infrastructure layer handler: Performs the actual API request to fetch transaction info from `tx/${txid}` endpoint.
    async getTxInfo({ txid }: { txid: string }): Promise<ITxResponse | null> {
      return this.client.makeRequest<ITxResponse>(`tx/${txid}`);
    }
  • src/main.ts:127-127 (registration)
    Instantiates TxToolsController in main application entrypoint, which triggers the registration of all its tools including 'get-tx-info'.
    new TxToolsController(server, txService);
  • Input schema definition for the 'get-tx-info' tool using Zod: txid as 64-character string.
    {
      txid: z.string().length(64).describe("The txid to get info for"),
    },

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