Skip to main content
Glama
Zzero-net

Zero Network MCP Server

by Zzero-net

zero_convert

Convert between USD, Z tokens, and units for crypto payment calculations in Zero Network applications.

Instructions

Convert between USD, Z tokens, and units.

Args: amount: The amount to convert direction: One of "usd_to_z", "z_to_usd", "z_to_units", "units_to_z"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountYes
directionNousd_to_z

Implementation Reference

  • Implementation of the zero_convert tool handler which performs currency/unit conversion.
    @mcp.tool()
    def zero_convert(amount: float, direction: str = "usd_to_z") -> str:
        """Convert between USD, Z tokens, and units.
    
        Args:
            amount: The amount to convert
            direction: One of "usd_to_z", "z_to_usd", "z_to_units", "units_to_z"
        """
        if direction == "usd_to_z":
            z = amount / 0.01
            units = int(z * 100)
            return f"${amount:.4f} USD = {z:.2f} Z = {units} units"
        elif direction == "z_to_usd":
            usd = amount * 0.01
            units = int(amount * 100)
            return f"{amount:.2f} Z = ${usd:.4f} USD = {units} units"
        elif direction == "z_to_units":
            units = int(amount * 100)
            usd = amount * 0.01
            return f"{amount:.2f} Z = {units} units = ${usd:.4f} USD"
        elif direction == "units_to_z":
            z = amount / 100
            usd = z * 0.01
            return f"{int(amount)} units = {z:.2f} Z = ${usd:.4f} USD"
        else:
            return f"Unknown direction '{direction}'. Use: usd_to_z, z_to_usd, z_to_units, units_to_z"

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/Zzero-net/mcp-server'

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