Skip to main content
Glama

helius_get_latest_blockhash

Retrieve the current blockhash from the Solana blockchain to validate transactions and ensure data integrity.

Instructions

Get the latest blockhash from the Solana blockchain

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commitmentNo

Implementation Reference

  • The core handler function that fetches the latest blockhash using the Helius SDK's connection.getLatestBlockhash method and formats the response.
    export const getLatestBlockhashHandler = async (input: GetLatestBlockhashInput): Promise<ToolResultSchema> => {
      try {
        const { blockhash, lastValidBlockHeight } = await (helius as any as Helius).connection.getLatestBlockhash(input.commitment);
        return createSuccessResponse(`Latest blockhash: ${blockhash}, Last valid block height: ${lastValidBlockHeight}`);
      } catch (error) {
        return createErrorResponse(`Error getting latest blockhash: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
  • Defines the tool's input schema, including optional commitment parameter.
    {
      name: "helius_get_latest_blockhash",
      description: "Get the latest blockhash from the Solana blockchain",
      inputSchema: {
        type: "object",
        properties: {
          commitment: { type: "string", enum: ["confirmed", "finalized", "processed"] }
        },
        required: []
      }
  • src/tools.ts:555-555 (registration)
    Maps the tool name to its handler function in the central handlers dictionary.
    "helius_get_latest_blockhash": getLatestBlockhashHandler,
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 for behavioral disclosure. It states what the tool does but lacks critical details: it doesn't specify if this is a read-only operation (implied but not explicit), potential rate limits, authentication requirements, or what the return format looks like (e.g., string, JSON). For a blockchain query tool with zero 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 a single, efficient sentence that front-loads the core purpose without any wasted words. It directly answers 'what does this tool do?' in a structured manner, making it easy for an agent to parse quickly. Every word earns its place, exemplifying ideal conciseness.

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?

Given the tool's low complexity (one optional parameter) and lack of annotations or output schema, the description is adequate but incomplete. It covers the basic action but misses behavioral context (e.g., safety, response format) and usage guidelines. For a simple read operation, this is minimally viable, but the absence of output details and sibling differentiation leaves room for improvement.

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 one parameter ('commitment') with an enum but 0% schema description coverage, meaning the schema provides no explanatory text. The description adds no parameter information beyond what's implied by the tool name. However, with only one optional parameter and a clear enum, the agent can reasonably infer usage, meeting the baseline for minimal viability despite the coverage gap.

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 verb ('Get') and resource ('latest blockhash from the Solana blockchain'), making the purpose immediately understandable. It distinguishes this tool from siblings like 'helius_get_block_height' or 'helius_get_slot' by specifying it returns a blockhash rather than other blockchain metrics. However, it doesn't explicitly contrast with all similar tools, preventing a perfect score.

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. It doesn't mention use cases like transaction signing, blockchain state verification, or how it differs from other block-related tools (e.g., 'helius_get_block_height' for numeric height). Without any context or exclusions, the agent must infer usage from the name alone.

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/dcSpark/mcp-server-helius'

If you have feedback or need assistance with the MCP directory API, please join our Discord server