Skip to main content
Glama

get-block

Retrieve detailed block information from blockchain networks using chain ID and block number parameters to access transaction data and network state.

Instructions

Get the block information of a chain

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainIdNo
blockNumberNo

Implementation Reference

  • Handler function that executes the 'get-block' tool logic: fetches block data using wagmi's getBlock with optional chainId and blockNumber, stringifies and returns as text content.
    execute: async (args) => {
      const chainId = args.chainId as typeof wagmiConfig['chains'][number]['id']
      const blockNumber = args.blockNumber ? BigInt(args.blockNumber) : undefined
      const result = await getBlock(wagmiConfig, {
        blockNumber,
        chainId,
        includeTransactions: false
      })
      return {
        content: [
          {
            type: "text",
            text: JSONStringify(result),
          },
        ],
      }
    },
  • Zod schema for tool parameters: optional chainId (number) and blockNumber (number).
    parameters: z.object({
      chainId: z.coerce.number().optional(),
      blockNumber: z.coerce.number().optional(),
    }),
  • Registration of the 'get-block' tool on the FastMCP server, including name, description, schema, and handler.
    server.addTool({
      name: "get-block",
      description: "Get the block information of a chain",
      parameters: z.object({
        chainId: z.coerce.number().optional(),
        blockNumber: z.coerce.number().optional(),
      }),
      execute: async (args) => {
        const chainId = args.chainId as typeof wagmiConfig['chains'][number]['id']
        const blockNumber = args.blockNumber ? BigInt(args.blockNumber) : undefined
        const result = await getBlock(wagmiConfig, {
          blockNumber,
          chainId,
          includeTransactions: false
        })
        return {
          content: [
            {
              type: "text",
              text: JSONStringify(result),
            },
          ],
        }
      },
    });
  • Top-level invocation registering the get-block tool on the main MCP server instance.
    registerGetBlockTools(server);
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 'Get[s] the block information', implying a read-only operation, but doesn't specify if it requires authentication, has rate limits, returns historical or latest data, or what format the information is in (e.g., JSON object). For a tool with zero annotation coverage, this is a significant gap in transparency about its behavior and constraints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence ('Get the block information of a chain'), which is appropriately concise and front-loaded with the core action. There's no wasted verbiage, making it easy to parse. However, it's overly terse, bordering on under-specified, which slightly reduces its effectiveness despite the efficient structure.

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 complexity (blockchain data retrieval), lack of annotations, no output schema, and low parameter coverage, the description is incomplete. It doesn't explain what 'block information' includes (e.g., hash, timestamp, transactions), return format, error conditions, or dependencies (e.g., chain must be connected). For a tool in this context, more detail is needed to guide the agent effectively.

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

Parameters2/5

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

The input schema has 2 parameters (chainId, blockNumber) with 0% description coverage, meaning they are undocumented in the schema. The description doesn't mention any parameters, failing to compensate for this gap. It doesn't explain what 'chainId' refers to (e.g., network identifier) or 'blockNumber' (e.g., specific block or latest), leaving their semantics unclear. With low schema coverage, the description adds no value beyond the schema.

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

Purpose3/5

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

The description states the tool 'Get[s] the block information of a chain', which provides a basic verb+resource ('get' + 'block information'). However, it's vague about what 'block information' entails (e.g., header, transactions, state) and doesn't differentiate from siblings like 'get-block-number' (which might return just the number) or 'get-transaction' (which retrieves transaction details). The purpose is clear but lacks specificity.

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. It doesn't mention prerequisites (e.g., needing a connected chain), exclusions (e.g., not for real-time data), or comparisons to siblings like 'get-block-number' (for just the number) or 'get-transaction' (for transaction details). The description offers no usage context, leaving the agent to infer based on the tool 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/Xiawpohr/mcpilot'

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