Skip to main content
Glama
alexandresanlim

Mempool MCP Server

get-block-header

Retrieve Bitcoin block header data in hexadecimal format by providing the specific block hash. This tool enables access to blockchain information for analysis and verification purposes.

Instructions

Returns the block header in hex

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hashYesThe block hash to get header for

Implementation Reference

  • Core handler logic that makes the API request to fetch the block header hex for the given block hash.
    async getBlockHeader({ hash }: { hash: string }): Promise<string | null> {
      return this.client.makeRequest<string>(`block/${hash}/header`);
    }
  • Registers the 'get-block-header' MCP tool with server, defining name, description, input schema, and thin handler delegating to service.
    private registerGetBlockHeaderHandler(): void {
      this.server.tool(
        "get-block-header",
        "Returns the block header in hex",
        {
          hash: z.string().length(64).describe("The block hash to get header for"),
        },
        async ({ hash }) => {
          const text = await this.blocksService.getBlockHeader({ hash });
          return { content: [{ type: "text", text }] };
        }
      );
    }
  • Zod schema for tool input: requires a 64-char hex block hash.
    {
      hash: z.string().length(64).describe("The block hash to get header for"),
    },
  • Intermediate service wrapper that calls the request service and formats the response text.
    async getBlockHeader({ hash }: { hash: string }): Promise<string> {
      const data = await this.requestService.getBlockHeader({ hash });
      return `Block Header: ${data}`;
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the return format ('in hex') but doesn't disclose behavioral traits such as error handling (e.g., invalid hash), performance (e.g., latency), or side effects (e.g., rate limits). The description is minimal and lacks critical operational context.

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 extremely concise ('Returns the block header in hex') with zero wasted words. It's front-loaded, directly stating the purpose. Every sentence (though only one) earns its place by conveying essential information efficiently.

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 no annotations, no output schema, and a simple input schema, the description is incomplete. It lacks details on return values (beyond 'in hex'), error conditions, or usage context. For a tool in a blockchain context with many siblings, more guidance is needed to ensure correct agent invocation.

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 the parameter 'hash' fully documented in the schema. The description adds no additional meaning beyond the schema, as it doesn't explain parameter usage, constraints, or examples. Baseline 3 is appropriate since the schema handles parameter documentation adequately.

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 ('block header'), specifying the output format ('in hex'). It distinguishes from siblings like 'get-block' or 'get-block-raw' by focusing on the header specifically. However, it doesn't explicitly differentiate from all siblings (e.g., 'get-block-txids' is clearly different, but the distinction could be more explicit).

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. For example, it doesn't specify if this is for lightweight header retrieval compared to 'get-block' (which might return full block data) or 'get-block-x' tools. The description lacks context about use cases or prerequisites.

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