validate_address
Verify Ethereum address format for Aave V3 protocol interactions to ensure accurate transaction processing and data queries.
Instructions
Validate if a string is a valid Ethereum address format.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | Address string to validate |
Implementation Reference
- src/index.ts:147-161 (registration)Tool registration in the listTools response, including name, description, and input schema definition.{ name: 'validate_address', description: 'Validate if a string is a valid Ethereum address format.', inputSchema: { type: 'object', properties: { address: { type: 'string', description: 'Address string to validate', }, }, required: ['address'], }, },
- src/index.ts:482-511 (handler)The main tool handler in the CallToolRequestSchema switch statement. Validates input, calls the helper method, and formats the response.case 'validate_address': { const address = args?.address as string; if (!address || typeof address !== 'string') { throw new McpError( ErrorCode.InvalidParams, 'address parameter is required and must be a string' ); } const isValid = aaveClient.isValidAddress(address); return { content: [ { type: 'text', text: JSON.stringify( { address, isValid, message: isValid ? 'Valid Ethereum address format' : 'Invalid Ethereum address format', }, null, 2 ), }, ], }; }
- src/aave-client.ts:344-346 (helper)Core helper method that performs the actual Ethereum address validation using ethers.js utility.isValidAddress(address: string): boolean { return ethers.isAddress(address); }