joules_deficit
Given a planned cost, read a balance and return {needed, have, shortfall, tool_to_call_next} so an
agent can decide in-band whether it can afford the next call — no website, no guessing, FREE. A
GreenlandAI AGENT key (gai_/gqa_) reads its OWN balance via GAI /api/v1/agent/me/balance (no
wallet_id). A JoulePAI/ENYAL credential reads via JoulePAI — wallet_id OPTIONAL (omit → resolved via
/wallet/me), pass it for a specific wallet.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cost | Yes | ||
| wallet_id | No |