Skip to main content
Glama
alexandresanlim

Mempool MCP Server

get-block-txid-by-index

Retrieve a specific transaction ID from a Bitcoin block by providing the block hash and transaction index position.

Instructions

Returns txid for a block at a specific index

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hashYesThe block hash to get txid for
indexYesThe index of the txid in the block

Implementation Reference

  • Core handler implementation that performs the actual API request to retrieve the txid by index using the client.
    async getBlockTxidByIndex({ hash, index }: { hash: string; index: number }): Promise<string | null> {
      return this.client.makeRequest<string>(`block/${hash}/txid/${index}`);
    }
  • Helper wrapper in BlocksService that calls the request service and formats the response text.
    async getBlockTxidByIndex({
      hash,
      index,
    }: {
      hash: string;
      index: number;
    }): Promise<string> {
      const data = await this.requestService.getBlockTxidByIndex({ hash, index });
      return `Block Txid By Index: ${data}`;
    }
  • Zod schema defining the input parameters for the tool: hash (64-char string) and index (integer).
    {
      hash: z.string().length(64).describe("The block hash to get txid for"),
      index: z.number().int().describe("The index of the txid in the block"),
    },
  • Registers the 'get-block-txid-by-index' tool with the MCP server, including description, schema, and thin handler delegating to BlocksService.
    private registerGetBlockTxidByIndexHandler(): void {
      this.server.tool(
        "get-block-txid-by-index",
        "Returns txid for a block at a specific index",
        {
          hash: z.string().length(64).describe("The block hash to get txid for"),
          index: z.number().int().describe("The index of the txid in the block"),
        },
        async ({ hash, index }) => {
          const text = await this.blocksService.getBlockTxidByIndex({ hash, index });
          return { content: [{ type: "text", text }] };
        }
      );
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of behavioral disclosure. It states the tool returns a txid but doesn't describe error handling (e.g., invalid hash or index), rate limits, authentication needs, or output format. This is inadequate for a tool with two required parameters and no output schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste. It's front-loaded with the core purpose and appropriately sized for a simple lookup tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (two required parameters, no output schema, and no annotations), the description is incomplete. It lacks details on return values, error conditions, and behavioral traits, leaving significant gaps for an AI agent to understand how to use it effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with both parameters ('hash' and 'index') well-documented in the schema. The description adds no additional meaning beyond implying the index refers to a transaction position in the block, which is already clear from the schema. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Returns') and resource ('txid for a block'), specifying it's for a particular index. It distinguishes from siblings like 'get-block-txids' (which likely returns all txids) by focusing on a single transaction ID at a specific index, though it doesn't explicitly name alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'get-block-txids' or 'get-block-txs'. The description implies usage for retrieving a specific transaction ID by index, but lacks explicit context, prerequisites, or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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