Skip to main content
Glama
alexandresanlim

Mempool MCP Server

get-block-raw

Retrieve raw hexadecimal data for Bitcoin blocks by providing the block hash. This tool enables direct access to complete block information for analysis and processing.

Instructions

Returns raw hex for a block

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hashYesThe block hash to get raw hex for

Implementation Reference

  • Core handler function that executes the API call to fetch raw block hex data from the endpoint `block/${hash}/raw`.
    async getBlockRaw({ hash }: { hash: string }): Promise<string | null> {
      return this.client.makeRequest<string>(`block/${hash}/raw`);
    }
  • Input schema validation using Zod for the 'hash' parameter (exactly 64 characters).
    {
      hash: z.string().length(64).describe("The block hash to get raw hex for"),
    },
  • Registers the 'get-block-raw' tool with the MCP server, specifying name, description, input schema, and thin handler that delegates to BlocksService.
    private registerGetBlockRawHandler(): void {
      this.server.tool(
        "get-block-raw",
        "Returns raw hex for a block",
        {
          hash: z.string().length(64).describe("The block hash to get raw hex for"),
        },
        async ({ hash }) => {
          const text = await this.blocksService.getBlockRaw({ hash });
          return { content: [{ type: "text", text }] };
        }
      );
    }
  • Helper method in BlocksService that wraps the request service call and adds a descriptive prefix to the raw hex response.
    async getBlockRaw({ hash }: IHashParameter): Promise<string> {
      const data = await this.requestService.getBlockRaw({ hash });
      return `Block Raw Hex: ${data}`;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool returns raw hex but doesn't specify what that entails (e.g., format details, error handling, performance characteristics, or if it's a read-only operation). For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior.

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 with a single sentence ('Returns raw hex for a block'), which is front-loaded and wastes no words. It efficiently communicates the core purpose without unnecessary elaboration.

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 lack of annotations and output schema, the description is incomplete. It doesn't explain what 'raw hex' means in practice (e.g., byte format, encoding), potential limitations, or how the result differs from other block tools. For a tool in a context with many siblings and no structured behavioral hints, more detail is needed to be fully helpful.

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?

The input schema has 100% description coverage, with the parameter 'hash' clearly documented as 'The block hash to get raw hex for'. The description doesn't add any additional meaning beyond this, but since the schema coverage is high, a baseline score of 3 is appropriate as the schema handles the 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 ('raw hex for a block'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'get-block' or 'get-block-txids', which might offer similar block-related data but in different formats or scopes.

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?

The description provides no guidance on when to use this tool versus alternatives. With many sibling tools like 'get-block' and 'get-block-txs' that might retrieve block information in different ways, there's no indication of when raw hex is preferred over structured data or other block-related queries.

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