Skip to main content
Glama

Lightning Tools MCP Server

by getAlby

fiat_to_sats

Convert fiat currency amounts into sats for Lightning Network transactions. Use this tool to process payments by specifying the currency and amount for accurate conversion.

Instructions

Convert fiat amounts to sats

Input Schema

NameRequiredDescriptionDefault
amountYesamount in sats
currencyYesthe fiat currency

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "amount": { "description": "amount in sats", "type": "number" }, "currency": { "description": "the fiat currency", "type": "string" } }, "required": [ "currency", "amount" ], "type": "object" }

Implementation Reference

  • The handler function that executes the tool: converts fiat amount to satoshis using external fiat.getSatoshiValue(params) and returns the satoshi value as text content.
    async (params) => { const satoshi = await fiat.getSatoshiValue(params); return { content: [ { type: "text", text: satoshi.toString(), }, ], }; }
  • Input schema defined with Zod validators for 'currency' (string) and 'amount' (number). Note: description for amount incorrectly states 'in sats'; it should be fiat amount.
    { currency: z.string().describe("the fiat currency"), amount: z.number().describe("amount in sats"), },
  • Core registration of the 'fiat_to_sats' tool using server.tool(), including name, description, input schema, and handler function.
    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)
    Calls the registerFiatToSatsTool function to register the tool on the MCP server instance during initialization.
    registerFiatToSatsTool(this._server);

Other Tools

Related Tools

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