Skip to main content
Glama

web3_clientVersion

Identify the client version of an EVM-compatible blockchain node to verify software compatibility and ensure proper network interaction.

Instructions

Returns the current client version

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'web3_clientVersion' tool. It calls the generic makeRPCCall helper with the method name to execute the RPC request, formats the result using formatResponse, and returns it as a text content response. Includes error handling.
    server.tool(
      "web3_clientVersion",
      "Returns the current client version",
      {},
      async () => {
        try {
          const result = await makeRPCCall("web3_clientVersion");
          return {
            content: [
              {
                type: "text",
                text: formatResponse(result, "Web3 Client Version"),
              },
            ],
          };
        } catch (error: any) {
          return {
            content: [
              {
                type: "text",
                text: `Error: ${error.message}`,
              },
            ],
          };
        }
      },
    );
  • Generic helper function used by the web3_clientVersion tool (and others) to perform RPC calls via the ethers JsonRpcProvider.
    async function makeRPCCall(method: string, params: any[] = []): Promise<any> {
      try {
        const result = await provider.send(method, params);
        return result;
      } catch (error: any) {
        throw new Error(`RPC call failed: ${error.message}`);
      }
    }
  • src/index.ts:100-126 (registration)
    Registration of the 'web3_clientVersion' tool using server.tool, including name, description, empty input schema, and handler function.
    server.tool(
      "web3_clientVersion",
      "Returns the current client version",
      {},
      async () => {
        try {
          const result = await makeRPCCall("web3_clientVersion");
          return {
            content: [
              {
                type: "text",
                text: formatResponse(result, "Web3 Client Version"),
              },
            ],
          };
        } catch (error: any) {
          return {
            content: [
              {
                type: "text",
                text: `Error: ${error.message}`,
              },
            ],
          };
        }
      },
    );
  • Empty input schema for the web3_clientVersion tool (no parameters required).
    {},

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/JamesANZ/evm-mcp'

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