Skip to main content
Glama
alexandresanlim

Mempool MCP Server

get-tx-outspend

Check if a Bitcoin transaction output has been spent by querying its spending transaction details using transaction ID and output index.

Instructions

Returns outspend info for a transaction output

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
txidYesThe txid to get outspend for
voutYesThe vout index to get outspend for

Implementation Reference

  • Registers the MCP tool 'get-tx-outspend' with server.tool, including tool name, description, Zod input schema (txid, vout), and async handler that delegates to TxService.getTxOutspend and returns MCP-formatted text content.
    private registerGetTxOutspendHandler(): void {
      this.server.tool(
        "get-tx-outspend",
        "Returns outspend info for a transaction output",
        {
          txid: z.string().length(64).describe("The txid to get outspend for"),
          vout: z.number().int().describe("The vout index to get outspend for"),
        },
        async ({ txid, vout }) => {
          const text = await this.txService.getTxOutspend({ txid, vout });
          return { content: [{ type: "text", text }] };
        }
      );
    }
  • Application service method getTxOutspend that calls the infrastructure request service and formats the response for the tool handler.
    async getTxOutspend({
      txid,
      vout,
    }: {
      txid: string;
      vout: number;
    }): Promise<string> {
      const data = await this.requestService.getTxOutspend({ txid, vout });
      return formatResponse<any>("Transaction Outspend", data);
    }
  • Infrastructure service method that makes the actual API request to fetch outspend data for the given txid and vout via IApiClient.
    async getTxOutspend({ txid, vout }: { txid: string; vout: number }): Promise<any | null> {
      return this.client.makeRequest<any>(`tx/${txid}/outspend/${vout}`);
    }

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