Skip to main content
Glama

Get Block Number

get_block_number
Read-only
Retrieves the block number and timestamp for a specific date/time or the latest block.
Use when you need a block height for a specific point in time (e.g., "block at 2024-01-01")
or the current chain tip. If `datetime` is provided, finds the block immediately
preceding that time. If omitted, returns the latest indexed block.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chain_idYesThe ID of the blockchain
datetimeNoThe date and time (ISO 8601 format, e.g. 2025-05-22T23:00:00.00Z) to find the block for. If omitted, returns the latest block.
session_idNoOpaque session identifier.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesThe main data payload of the tool's response.
notesNoA list of important contextual notes, such as warnings about data truncation or data quality issues.
paginationNoPagination information, present only if the 'data' is a single page of a larger result set.
content_textNoOptional human-readable summary used for MCP content responses.
instructionsNoA list of suggested follow-up actions or instructions for the LLM to plan its next steps.
data_descriptionNoA list of notes explaining the structure, fields, or conventions of the 'data' payload.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / session_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Opaque session identifier.",
      +  "title": "Session Id"
      +}
  2. Changed10 schema fields changed
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / chain_id / title
      Added value: +"Chain Id"
    • addedInput schema / properties / datetime / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / datetime / default
      Added value: +null
    • changedInput schema / properties / datetime / description
      Previous value: -"ISO 8601 date/time to find the block for. If omitted, returns latest block."New value: +"The date and time (ISO 8601 format, e.g. 2025-05-22T23:00:00.00Z) to find the block for. If omitted, returns the latest block."
    • addedInput schema / properties / datetime / title
      Added value: +"Datetime"
    • removedInput schema / properties / datetime / type
      Removed value: -"string"
    • addedInput schema / title
      Added value: +"get_block_numberArguments"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$defs": {
      +    "BlockNumberData": {
      +      "description": "Represents the essential data for a resolved block number.",
      +      "properties": {
      +        "block_number": {
      +          "description": "The block number (height) in the blockchain",
      +          "title": "Block Number",
      +          "type": "integer"
      +        },
      +        "timestamp": {
      +          "description": "The timestamp when the block was mined (ISO format)",
      +          "title": "Timestamp",
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "block_number",
      +        "timestamp"
      +      ],
      +      "title": "BlockNumberData",
      +      "type": "object"
      +    },
      +    "NextCallInfo": {
      +      "description": "A structured representation of the tool call required to get the next page.",
      +      "properties": {
      +        "params": {
      +          "additionalProperties": true,
      +          "description": "A complete dictionary of parameters for the next tool call, including the new cursor.",
      +          "title": "Params",
      +          "type": "object"
      +        },
      +        "tool_name": {
      +          "description": "The name of the tool to call for the next page.",
      +          "title": "Tool Name",
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "tool_name",
      +        "params"
      +      ],
      +      "title": "NextCallInfo",
      +      "type": "object"
      +    },
      +    "PaginationInfo": {
      +      "description": "Contains the structured information needed to retrieve the next page of results.",
      +      "properties": {
      +        "next_call": {
      +          "$ref": "#/$defs/NextCallInfo",
      +          "description": "The structured tool call required to fetch the subsequent page."
      +        }
      +      },
      +      "required": [
      +        "next_call"
      +      ],
      +      "title": "PaginationInfo",
      +      "type": "object"
      +    }
      +  },
      +  "properties": {
      +    "content_text": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null,
      +      "description": "Optional human-readable summary used for MCP content responses.",
      +      "title": "Content Text"
      +    },
      +    "data": {
      +      "$ref": "#/$defs/BlockNumberData",
      +      "description": "The main data payload of the tool's response."
      +    },
      +    "data_description": {
      +      "anyOf": [
      +        {
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null,
      +      "description": "A list of notes explaining the structure, fields, or conventions of the 'data' payload.",
      +      "title": "Data Description"
      +    },
      +    "instructions": {
      +      "anyOf": [
      +        {
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null,
      +      "description": "A list of suggested follow-up actions or instructions for the LLM to plan its next steps.",
      +      "title": "Instructions"
      +    },
      +    "notes": {
      +      "anyOf": [
      +        {
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null,
      +      "description": "A list of important contextual notes, such as warnings about data truncation or data quality issues.",
      +      "title": "Notes"
      +    },
      +    "pagination": {
      +      "anyOf": [
      +        {
      +          "$ref": "#/$defs/PaginationInfo"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null,
      +      "description": "Pagination information, present only if the 'data' is a single page of a larger result set."
      +    }
      +  },
      +  "required": [
      +    "data"
      +  ],
      +  "title": "ToolResponse[BlockNumberData]",
      +  "type": "object"
      +}
  3. Added

TDQS

A4.5/5.0
Behavior4/5

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

The description adds behavioral nuance beyond the read-only annotation, such as 'finds the block immediately preceding that time' and 'returns the latest indexed block,' implying possible indexing delay. It clarifies the return includes timestamp as well as number. No contradictions with annotations.

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 three sentences with no filler. It front-loads the purpose, then usage, then conditional behavior, each sentence adding value. It is appropriately sized for a simple tool.

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

Completeness5/5

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

For a tool with an output schema, the description covers the essential aspects: purpose, usage, and datetime behavior. It clarifies the 'latest' case as 'latest indexed block,' which is important context. With all parameters documented in the schema, the description is complete for this simple tool.

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

Parameters4/5

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

The schema already describes all three parameters, providing a baseline of 3. The description enriches the datetime parameter by specifying it finds the block immediately preceding the given time and that omitting it returns the latest indexed block. This adds semantic value beyond the schema's 'to find the block for.'

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?

The description clearly states the tool retrieves block number and timestamp either for a given datetime or the latest block. It uses specific verb 'Retrieves' and resource 'block number and timestamp,' distinguishing it from sibling get_block_info which likely returns block details. The tool's purpose is unambiguous.

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

Usage Guidelines4/5

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

The description explicitly states when to use the tool: when needing a block height for a specific point in time or the current chain tip. It doesn't explicitly name alternatives or when-not-to-use, but the use case is clearly defined. The distinction between providing or omitting datetime is explained.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.