Skip to main content
Glama

get-block-number

Retrieve the current block number for a specified blockchain to monitor network status and synchronize transactions.

Instructions

Get the block nunber of a chain

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainIdNo

Implementation Reference

  • The execute handler function that retrieves the current block number using Wagmi's getBlockNumber action and returns it as a text content block.
    execute: async (args) => {
      const chainId = args.chainId as typeof wagmiConfig['chains'][number]['id']
      const result = await getBlockNumber(wagmiConfig, {
        chainId,
      })
      return {
        content: [
          {
            type: "text",
            text: result.toString(),
          },
        ],
      }
    },
  • Zod schema defining the optional chainId parameter for the tool.
    parameters: z.object({
      chainId: z.coerce.number().optional(),
    }),
  • Registers the get-block-number tool on the FastMCP server instance, including name, description, schema, and handler.
      server.addTool({
        name: "get-block-number",
        description: "Get the block nunber of a chain",
        parameters: z.object({
          chainId: z.coerce.number().optional(),
        }),
        execute: async (args) => {
          const chainId = args.chainId as typeof wagmiConfig['chains'][number]['id']
          const result = await getBlockNumber(wagmiConfig, {
            chainId,
          })
          return {
            content: [
              {
                type: "text",
                text: result.toString(),
              },
            ],
          }
        },
      });
    };
  • Invokes the tool registration function on the main MCP server instance.
    registerGetBlockNumberTools(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 retrieves a block number, implying a read-only operation, but doesn't disclose any behavioral traits such as error handling, performance characteristics, authentication needs, or rate limits. The description is minimal and adds little context beyond the basic action.

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

Conciseness3/5

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

The description is a single sentence, which is appropriately sized for a simple tool. However, it contains a typo ('nunber'), and the structure is basic without front-loading critical information. It's concise but could be more polished and informative without adding unnecessary length.

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 tool's complexity (simple retrieval with 1 parameter), no annotations, no output schema, and low schema coverage, the description is incomplete. It doesn't explain what the tool returns (e.g., a numeric block number), how errors are handled, or provide enough context for reliable use. The minimal description leaves significant gaps in understanding the tool's behavior and output.

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 1 parameter ('chainId') with 0% schema description coverage, meaning the schema provides no documentation. The description mentions 'of a chain', which loosely relates to 'chainId', but doesn't explain what 'chainId' is, its format, valid values, or how it affects the block number retrieval. The description adds minimal meaning beyond the schema, insufficient to compensate for the low coverage.

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

Purpose2/5

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

The description 'Get the block nunber of a chain' states a purpose but is vague and contains a typo ('nunber' instead of 'number'). It specifies a verb ('Get') and resource ('block number of a chain'), but doesn't clearly differentiate from sibling tools like 'get-block' (which might retrieve full block details) or 'get-chain-id' (which retrieves chain identifier). The purpose is somewhat clear but lacks specificity and distinction.

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 prerequisites, context, or exclusions, and doesn't reference sibling tools like 'get-block' or 'get-chain-id' that might serve similar or overlapping purposes. Usage is implied only by the tool name, with no explicit instructions.

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