Skip to main content
Glama
alexandresanlim

Mempool MCP Server

get-tx-raw

Retrieve the raw hexadecimal data for any Bitcoin transaction by providing its transaction ID (txid). This tool enables developers to access complete transaction details directly from the Bitcoin blockchain for analysis, verification, or integration purposes.

Instructions

Returns raw hex for a transaction

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
txidYesThe txid to get raw hex for

Implementation Reference

  • Registration of the MCP tool 'get-tx-raw', including input schema (txid: string length 64) and handler that delegates to TxService.getTxRaw and formats response
    private registerGetTxRawHandler(): void { this.server.tool( "get-tx-raw", "Returns raw hex for a transaction", { txid: z.string().length(64).describe("The txid to get raw hex for"), }, async ({ txid }) => { const text = await this.txService.getTxRaw({ txid }); return { content: [{ type: "text", text }] }; } ); }
  • TxService.getTxRaw method: fetches raw tx from request service and prefixes with 'Transaction Raw Hex: '
    async getTxRaw({ txid }: { txid: string }): Promise<string> { const data = await this.requestService.getTxRaw({ txid }); return `Transaction Raw Hex: ${data}`; }
  • TxRequestService.getTxRaw: makes API request to `/tx/{txid}/raw` endpoint to retrieve raw transaction hex
    async getTxRaw({ txid }: { txid: string }): Promise<string | null> { return this.client.makeRequest<string>(`tx/${txid}/raw`); }

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