balance
Check wallet balance on Fewsats MCP Server. Use this tool to troubleshoot payment issues or verify funds when instructed by the user.
Instructions
Retrieve the balance of the user's wallet. You will rarely need to call this unless instructed by the user, or to troubleshoot payment issues. Fewsats will automatically add balance when needed.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/fewsats_mcp/server.py:14-19 (handler)Handler for the 'balance' MCP tool. Decorated with @mcp.tool(), it retrieves the user's wallet balance by calling Fewsats().balance() and returns the handled response.@mcp.tool() async def balance() -> str: """Retrieve the balance of the user's wallet. You will rarely need to call this unless instructed by the user, or to troubleshoot payment issues. Fewsats will automatically add balance when needed.""" return handle_response(Fewsats().balance())
- src/fewsats_mcp/server.py:9-11 (helper)Helper function used by the 'balance' tool (and others) to process the HTTP response from the Fewsats API, returning status code and JSON or text body.def handle_response(response): try: return response.status_code, response.json() except: return response.status_code, response.text