Skip to main content
Glama
alexandresanlim

Mempool MCP Server

get-tx-raw

Retrieve raw hexadecimal data for any Bitcoin transaction using its transaction ID (txid). Includes schema validation for accurate query execution.

Instructions

Returns raw hex for a transaction

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
txidYesThe txid to get raw hex for

Implementation Reference

  • Registers the MCP tool 'get-tx-raw' including input schema (txid: string length 64), description, and handler function that fetches raw tx via TxService and returns as text content.
    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 delegates to TxRequestService.getTxRaw and adds a prefix to the raw hex string.
    async getTxRaw({ txid }: { txid: string }): Promise<string> { const data = await this.requestService.getTxRaw({ txid }); return `Transaction Raw Hex: ${data}`; }
  • Performs the actual API request to retrieve the raw transaction hex using the API client.
    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