validate_address
Check if a string matches Ethereum address format to ensure valid inputs for Aave V3 position analysis and liquidation monitoring.
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:482-511 (handler)The execution handler for the 'validate_address' tool. It validates the input parameter, calls aaveClient.isValidAddress(), and returns a JSON response with the validation result.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/index.ts:147-161 (schema)Input schema definition for the 'validate_address' tool, registered in the listTools response.{ 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/aave-client.ts:341-346 (helper)Helper method in AaveClient class that performs the actual Ethereum address validation using the ethers library utility./** * Validate Ethereum address format */ isValidAddress(address: string): boolean { return ethers.isAddress(address); }