Skip to main content
Glama
alexandresanlim

Mempool MCP Server

get-block

Retrieve detailed Bitcoin block information by providing the block hash, enabling access to blockchain data for analysis and verification purposes.

Instructions

Returns details about a block from hash

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hashYesThe hash info to get block

Implementation Reference

  • Registers the 'get-block' MCP tool, defining its schema (hash: string length 64), description, and handler function that delegates to BlockService.getBlock and returns formatted text content.
    private registerGetRecommendedFeesHandler(): void {
      this.server.tool(
        "get-block",
        "Returns details about a block from hash",
        {
          hash: z.string().length(64).describe("The hash info to get block"),
        },
        async ({ hash }: IHashParameter) => {
          const text = await this.service.getBlock({ hash });
    
          return {
            content: [
              {
                type: "text",
                text: text,
              },
            ],
          };
        }
      );
    }
  • Handler in BlockService that fetches block data from BlockRequestService and formats the response using formatResponse.
    async getBlock({ hash }: IHashParameter): Promise<string> {
      const data = await this.requestService.getBlock({ hash });
      return formatResponse<IBlockResponse>("Details about a block.", data);
    }
  • Core handler in BlockRequestService that performs the API request to retrieve block details using the hash.
    async getBlock({ hash }: IHashParameter): Promise<IBlockResponse | null> {
      return this.client.makeRequest<IBlockResponse>(`block/${hash}`);
    }
  • TypeScript interface defining the input parameter structure for the get-block tool (hash: string). Note: Zod schema in controller adds length(64) validation.
    export interface IHashParameter {
      hash: string;
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.5/5.0
Behavior2/5

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

No annotations provided, and the description does not disclose behavioral traits like side effects, read-only nature, or response format. The phrase 'Returns details' lacks specificity.

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?

Single sentence with no wasted words; front-loaded with the key action and resource.

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

Completeness3/5

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

For a simple one-parameter tool without output schema, the description is minimally adequate but lacks information about what 'details' are returned, reducing completeness.

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 coverage is 100% (1 parameter fully described), so baseline is 3. The description 'The hash info to get block' adds minimal meaning beyond the existing schema definition.

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

Purpose5/5

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

Description uses specific verb 'Returns' and resource 'block' with input 'hash', clearly distinguishing from sibling tools like get-ping and get-recommended-fees which have different purposes.

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

Usage Guidelines3/5

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

No explicit guidance on when to use this tool versus alternatives, but the description's specificity makes usage obvious given the siblings' distinct functions.

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