Skip to main content
Glama

parseEther

Convert ether values into a standardized format for blockchain transactions. Simplifies handling ether amounts in Ethereum networks through the MCP Ethers Wallet.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
etherYesThe ether value to parse

Implementation Reference

  • The handler function for the parseEther tool. It takes an 'ether' string input, converts it to wei using ethers.parseEther(ether), and returns the wei value as a string. Includes error handling.
    async ({ ether }) => { try { const weiValue = ethers.parseEther(ether); return { content: [{ type: "text", text: weiValue.toString() }] }; } catch (error) { return { isError: true, content: [{ type: "text", text: `Error parsing ether: ${error instanceof Error ? error.message : String(error)}` }] }; } }
  • Input schema for parseEther tool: requires a single 'ether' parameter as a string.
    { ether: z.string().describe( "The ether value to parse" ) },
  • Registration of the parseEther tool on the MCP server, including schema and handler.
    "parseEther", { ether: z.string().describe( "The ether value to parse" ) }, async ({ ether }) => { try { const weiValue = ethers.parseEther(ether); return { content: [{ type: "text", text: weiValue.toString() }] }; } catch (error) { return { isError: true, content: [{ type: "text", text: `Error parsing ether: ${error instanceof Error ? error.message : String(error)}` }] }; } } );

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/crazyrabbitLTC/mcp-ethers-server'

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