Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
costYes
wallet_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
haveNo
neededNo
shortfallNo0 means affordable now
tool_to_call_nextNonull when nothing is owed

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "description": "joules_deficit — computed by this relay, not relayed.",
      +  "properties": {
      +    "have": {
      +      "anyOf": [
      +        {
      +          "type": "integer"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null,
      +      "title": "Have"
      +    },
      +    "needed": {
      +      "anyOf": [
      +        {
      +          "type": "integer"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null,
      +      "title": "Needed"
      +    },
      +    "shortfall": {
      +      "anyOf": [
      +        {
      +          "type": "integer"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null,
      +      "description": "0 means affordable now",
      +      "title": "Shortfall"
      +    },
      +    "tool_to_call_next": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null,
      +      "description": "null when nothing is owed",
      +      "title": "Tool To Call Next"
      +    }
      +  },
      +  "title": "DeficitOut",
      +  "type": "object"
      +}
  2. Changed2 schema fields changed
    • addedInput schema / properties / wallet_id / default
      Added value: +null
    • changedInput schema / required
      Previous value: -[
      -  "wallet_id",
      -  "cost"
      -]New value: +[
      +  "cost"
      +]
  3. First observed

TDQS

A4.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It discloses that it reads balance via specific API endpoints, is free, and returns a structured result. However, it does not mention whether the operation is read-only (though implied), any error behavior, or rate limits. It provides moderate transparency but lacks some edge-case context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with no waste. The purpose, return value, and credential handling are all front-loaded, making it efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers the tool's purpose, return structure, credential types, API endpoints, and parameter nuances. It is complete for an agent to decide when and how to call it, given that an output schema exists and the description already explains the returned fields.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must fully explain parameters. It does: cost is the planned cost, and wallet_id is optional with behavior described (omit to resolve via /wallet/me, or pass for a specific wallet). This adds significant meaning beyond the bare schema fields.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool reads a balance for a planned cost and returns a structured decision object {needed, have, shortfall, tool_to_call_next}. It uses specific verbs and resources, and distinguishes itself from siblings like joules_balance by focusing on affordability decision rather than just balance reading.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains when to use the tool (to decide if the agent can afford the next call) and provides context on credential types and wallet_id optionality. It does not explicitly name alternatives or state when not to use it, but the context is clear enough for an agent to select it appropriately.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources