iota_wallet_balance
Check the IOTA balance of your active wallet to monitor cryptocurrency holdings and verify transaction status.
Instructions
Check IOTA balance for the active wallet
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:125-130 (handler)Registration of the iota_wallet_balance tool, which calls the wallet helper function with the /balance endpoint.
server.tool( "iota_wallet_balance", "Check IOTA balance for the active wallet", {}, async () => text(await wallet("/balance")) ); - src/index.ts:87-98 (helper)Helper function that executes the actual API request to the wallet server.
async function wallet(path: string, method = "GET", body?: unknown): Promise<string> { try { const opts: RequestInit = { method, headers: { "Content-Type": "application/json" }, }; if (body) opts.body = JSON.stringify(body); const res = await fetch(`${WALLET_SERVER}${path}`, opts); if (!res.ok) return `Wallet server error ${res.status}: ${res.statusText}`; return await res.text(); } catch (err: any) { return `Wallet server unreachable (${WALLET_SERVER}): ${err.message}. Start the agent-wallet server first.`;