Skip to main content
Glama
monad-vibe

Monad MCP Server

by monad-vibe

get-latest-block

Retrieve the most recent block data from the Monad testnet for monitoring transactions, smart contracts, and network activity using the MCP server.

Instructions

Get the latest block on Monad testnet

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The async handler function that fetches the latest block using publicClient.getBlock(), extracts key properties (number, hash, timestamp, tx count, parentHash, gasUsed, gasLimit), formats them into a markdown-like text response, and handles errors by returning an error message.
    async () => {
        try {
            const block = await publicClient.getBlock();
            return {
                content: [
                    {
                        type: "text",
                        text: `Block Number: ${block.number}
                            Hash: ${block.hash}
                            Timestamp: ${block.timestamp}
                            Transaction Count: ${block.transactions.length}
                            Parent Hash: ${block.parentHash}
                            Gas Used: ${block.gasUsed}
                            Gas Limit: ${block.gasLimit}`,
                    },
                ],
            };
        } catch (error) {
            return {
                content: [
                    {
                        type: "text",
                        text: `Failed to retrieve the latest block. Error: ${error instanceof Error ? error.message : String(error)}`,
                    },
                ],
            };
        }
    }
  • Direct registration of the 'get-latest-block' tool on the MCP server, including name, description, empty input schema ({}), and inline handler function.
    server.tool(
        "get-latest-block",
        "Get the latest block on Monad testnet",
        {},
        async () => {
            try {
                const block = await publicClient.getBlock();
                return {
                    content: [
                        {
                            type: "text",
                            text: `Block Number: ${block.number}
                                Hash: ${block.hash}
                                Timestamp: ${block.timestamp}
                                Transaction Count: ${block.transactions.length}
                                Parent Hash: ${block.parentHash}
                                Gas Used: ${block.gasUsed}
                                Gas Limit: ${block.gasLimit}`,
                        },
                    ],
                };
            } catch (error) {
                return {
                    content: [
                        {
                            type: "text",
                            text: `Failed to retrieve the latest block. Error: ${error instanceof Error ? error.message : String(error)}`,
                        },
                    ],
                };
            }
        }
    );
  • blockProvider function that calls getLatestBlockProvider(server) to register the get-latest-block tool (and get-block-by-number).
    export function blockProvider(server: McpServer) {
        getLatestBlockProvider(server);
        getBlockByNumberProvider(server);
    }
  • src/index.ts:27-27 (registration)
    Invocation of blockProvider during main server initialization to register block tools including 'get-latest-block'.
    blockProvider(server);
  • Provider function exported for use in block/index.ts, which registers the tool.
    export function getLatestBlockProvider(server: McpServer) {
        server.tool(
            "get-latest-block",
            "Get the latest block on Monad testnet",
            {},
            async () => {
                try {
                    const block = await publicClient.getBlock();
                    return {
                        content: [
                            {
                                type: "text",
                                text: `Block Number: ${block.number}
                                    Hash: ${block.hash}
                                    Timestamp: ${block.timestamp}
                                    Transaction Count: ${block.transactions.length}
                                    Parent Hash: ${block.parentHash}
                                    Gas Used: ${block.gasUsed}
                                    Gas Limit: ${block.gasLimit}`,
                            },
                        ],
                    };
                } catch (error) {
                    return {
                        content: [
                            {
                                type: "text",
                                text: `Failed to retrieve the latest block. Error: ${error instanceof Error ? error.message : String(error)}`,
                            },
                        ],
                    };
                }
            }
        );
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states what the tool does but provides no information about rate limits, authentication requirements, network behavior, error responses, or what 'latest' means in practical terms (e.g., is it cached, real-time, etc.). For a blockchain query tool with zero annotation coverage, this leaves significant behavioral gaps.

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 states exactly what the tool does with zero wasted words. It's appropriately sized for a simple query tool and front-loads the essential information. Every word earns its place in this minimal description.

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 that this is a blockchain query tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what format the block data will be returned in, what fields to expect, or any behavioral characteristics. For a tool that presumably returns complex blockchain data, more context about the response would be helpful despite the lack of output schema.

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 tool has zero parameters, and schema description coverage is 100%. The description appropriately doesn't discuss parameters since none exist. It could theoretically mention that no parameters are required, but this is adequately covered by the structured schema. With 0 parameters, the baseline is appropriately high.

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 action ('Get') and resource ('latest block on Monad testnet'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'get-block-by-number', but the focus on 'latest' provides some distinction. The description is specific enough to understand what the tool does without being tautological.

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 like 'get-block-by-number'. It doesn't mention prerequisites, error conditions, or any context about when this specific tool is appropriate. The agent must infer usage from the tool name alone, which is insufficient for optimal tool selection.

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

Related 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/monad-vibe/monad-mcp-server'

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