get_balance
Retrieve the current account balance in USD from DIDLogic via the didlogic_mcp server. Returns a JSON object with the balance for easy integration and usage.
Instructions
Get the current DIDLogic account balance
Returns a JSON object with balance in USD
Example output: {"balance": 35.22}
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/didlogic_mcp/tools/balance.py:7-16 (handler)The get_balance tool handler: an async function decorated with @mcp.tool() that fetches the account balance from the Didlogic API /v1/balance endpoint and returns it as a JSON string.@mcp.tool() async def get_balance(ctx: Context) -> str: """ Get the current DIDLogic account balance Returns a JSON object with balance in USD Example output: `{"balance": 35.22}` """ response = await base.call_didlogic_api(ctx, "GET", "/v1/balance") return response.text
- src/didlogic_mcp/server.py:99-99 (registration)Registers the balance tools module (including get_balance) on the FastMCP server instance.tools.balance.register_tools(mcp)