Skip to main content
Glama
lienhage

Blockchain MCP Server

by lienhage

Validate Ethereum Address

validate-ethereum-address

Verify the correctness of an Ethereum address using the Blockchain MCP Server tool, ensuring it meets the required format and standards.

Instructions

Validate the validity of an Ethereum address

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesEthereum address to validate

Implementation Reference

  • The handler function for the 'validate-ethereum-address' tool. It uses ethers.isAddress(address) to validate the Ethereum address, computes the checksummed version if valid, and returns a formatted text response indicating validity.
          async ({ address }) => {
            try {
              const isValid = ethers.isAddress(address);
              const checksumAddress = isValid ? ethers.getAddress(address) : null;
              
              return {
                content: [{
                  type: "text",
                  text: `Address validation result:
    šŸ”¹ Original Address: ${address}
    šŸ”¹ Valid: ${isValid ? 'āœ… Valid' : 'āŒ Invalid'}
    ${checksumAddress ? `šŸ”¹ Checksum Address: ${checksumAddress}` : ''}`
                }]
              };
            } catch (error) {
              return {
                content: [{
                  type: "text",
                  text: `Error validating address: ${error instanceof Error ? error.message : String(error)}`
                }],
                isError: true
              };
            }
          }
  • The input schema for the 'validate-ethereum-address' tool, defining the 'address' parameter using Zod.
    {
      title: "Validate Ethereum Address",
      description: "Validate the validity of an Ethereum address",
      inputSchema: {
        address: z.string().describe("Ethereum address to validate")
      }
    },
  • Registration of the 'validate-ethereum-address' tool on the McpServer, including schema and inline handler function.
        server.registerTool(
          "validate-ethereum-address",
          {
            title: "Validate Ethereum Address",
            description: "Validate the validity of an Ethereum address",
            inputSchema: {
              address: z.string().describe("Ethereum address to validate")
            }
          },
          async ({ address }) => {
            try {
              const isValid = ethers.isAddress(address);
              const checksumAddress = isValid ? ethers.getAddress(address) : null;
              
              return {
                content: [{
                  type: "text",
                  text: `Address validation result:
    šŸ”¹ Original Address: ${address}
    šŸ”¹ Valid: ${isValid ? 'āœ… Valid' : 'āŒ Invalid'}
    ${checksumAddress ? `šŸ”¹ Checksum Address: ${checksumAddress}` : ''}`
                }]
              };
            } catch (error) {
              return {
                content: [{
                  type: "text",
                  text: `Error validating address: ${error instanceof Error ? error.message : String(error)}`
                }],
                isError: true
              };
            }
          }
        );
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 only states the validation action without detailing traits like whether it's read-only (implied but not explicit), what validation criteria are used (e.g., checksum, length), error handling, or performance aspects. This leaves significant gaps for an agent to understand the tool's behavior beyond the basic purpose.

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 with zero waste. It's appropriately sized for a simple tool and front-loaded with the core purpose. Every word earns its place, making it easy to parse quickly without unnecessary elaboration.

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 simplicity (1 parameter, no output schema, no annotations), the description is incomplete. It lacks details on what constitutes a valid address, return values (e.g., boolean success/failure, error messages), or integration context. For a validation tool, this leaves the agent unsure of the outcome or how to interpret results, making it inadequate despite the straightforward function.

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

Parameters3/5

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

The input schema has 100% description coverage, with the 'address' parameter clearly documented. The description adds no additional meaning beyond what the schema provides, such as format examples or validation specifics. Since schema coverage is high, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

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's purpose ('Validate the validity of an Ethereum address'), which is clear but vague. It specifies the verb ('validate') and resource ('Ethereum address'), but doesn't distinguish from siblings like 'generate-vanity-address' or 'get-balance' beyond the validation focus. The phrasing 'validity of an Ethereum address' is somewhat tautological but still conveys the core function.

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. The description doesn't mention prerequisites, context, or exclusions, such as whether it's for input validation before transactions or checking address formats. With siblings like 'send-transaction' and 'get-balance', there's no indication of when validation is necessary versus other operations.

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/lienhage/blockchain-mcp'

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