Skip to main content
Glama
getAlby

Lightning Tools MCP Server

by getAlby

fiat_to_sats

Convert fiat currency amounts to satoshis (sats) for Lightning Network transactions. Enter the currency and amount to calculate the equivalent value in sats.

Instructions

Convert fiat amounts to sats

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
currencyYesthe fiat currency
amountYesamount in sats

Implementation Reference

  • The handler function that converts the fiat amount to satoshis using the external 'fiat' library and returns the result as MCP content.
    async (params) => { const satoshi = await fiat.getSatoshiValue(params); return { content: [ { type: "text", text: satoshi.toString(), }, ], }; }
  • Zod schema defining input parameters: currency (string) and amount (number). Note: description for amount may be misleading as it's fiat amount to convert to sats.
    { currency: z.string().describe("the fiat currency"), amount: z.number().describe("amount in sats"), },
  • The server.tool call within registerFiatToSatsTool that registers the tool with name, description, schema, and handler.
    server.tool( "fiat_to_sats", "Convert fiat amounts to sats", { currency: z.string().describe("the fiat currency"), amount: z.number().describe("amount in sats"), }, async (params) => { const satoshi = await fiat.getSatoshiValue(params); return { content: [ { type: "text", text: satoshi.toString(), }, ], }; } );
  • src/index.ts:29-29 (registration)
    Invocation of registerFiatToSatsTool during server constructor to perform the tool registration.
    registerFiatToSatsTool(this._server);
  • Import of the registerFiatToSatsTool function.
    import { registerFiatToSatsTool } from "./tools/fiat_to_sats.js";

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/getAlby/lightning-tools-mcp-server'

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