Skip to main content
Glama

joules_deficit

Read-only

Can you afford the next call? Give a planned cost; returns {needed, have, shortfall, tool_to_call_next}. Free. Agent keys read their own wallet; a JoulePAI or ENYAL credential may pass wallet_id.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "cost": "<cost>"
    },
    "name": "joules_deficit"
  }
}

Input Schema

NameRequiredDescriptionDefault
costYesThe joules the next call will cost (its joules_all_in from billing_quote).
wallet_idNoWallet to read (UUID); omit to use your own. Not used with a GreenlandAI agent key.

Output Schema

NameRequiredDescriptionDefault
haveNo
neededNo
shortfallNo
tool_to_call_nextNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed16 schema fields changed
    • removedInput schema / properties / cost / title
      Removed value: -"Cost"
    • removedInput schema / properties / wallet_id / default
      Removed value: -null
    • removedInput schema / properties / wallet_id / title
      Removed value: -"Wallet Id"
    • removedInput schema / title
      Removed value: -"joules_deficitArguments"
    • removedOutput schema / description
      Removed value: -"joules_deficit — computed by this relay, not relayed."
    • removedOutput schema / properties / have / default
      Removed value: -null
    • removedOutput schema / properties / have / title
      Removed value: -"Have"
    • removedOutput schema / properties / needed / default
      Removed value: -null
    • removedOutput schema / properties / needed / title
      Removed value: -"Needed"
    • removedOutput schema / properties / shortfall / default
      Removed value: -null
    • removedOutput schema / properties / shortfall / description
      Removed value: -"0 means affordable now"
    • removedOutput schema / properties / shortfall / title
      Removed value: -"Shortfall"
    • removedOutput schema / properties / tool_to_call_next / default
      Removed value: -null
    • removedOutput schema / properties / tool_to_call_next / description
      Removed value: -"null when nothing is owed"
    • removedOutput schema / properties / tool_to_call_next / title
      Removed value: -"Tool To Call Next"
    • removedOutput schema / title
      Removed value: -"DeficitOut"
  2. Changed4 schema fields changed
    • addedInput schema / properties / cost / description
      Added value: +"The joules the next call will cost (its joules_all_in from billing_quote)."
    • addedInput schema / properties / wallet_id / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / wallet_id / description
      Added value: +"Wallet to read (UUID); omit to use your own. Not used with a GreenlandAI agent key."
    • removedInput schema / properties / wallet_id / type
      Removed value: -"string"
  3. 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"
      +}
  4. Changed2 schema fields changed
    • addedInput schema / properties / wallet_id / default
      Added value: +null
    • changedInput schema / required
      Previous value: -[
      -  "wallet_id",
      -  "cost"
      -]New value: +[
      +  "cost"
      +]
  5. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already cover read-only/non-destructive/closed-world, so the description adds context beyond them: the call is free, agent keys read their own wallet, only JoulePAI/ENYAL credentials may supply wallet_id, and GreenlandAI keys cannot. That credential/wallet-routing detail is genuinely useful and not in the annotations, though nothing is said about rate limits or handling of a nonzero shortfall.

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?

Four short clauses, front-loaded with the decision question, then the required input, the return shape, the free-of-charge note, and the credential caveat. No filler and no repetition of the schema.

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

Completeness4/5

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

With annotations and an output schema already present, the description only needs to establish intent and auth context, which it does. The one gap is what an agent should do when shortfall > 0 (presumably follow tool_to_call_next), which it leaves implicit.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3; the description goes further by clarifying that `cost` is a planned next-call cost and by stating the credential rules that govern whether `wallet_id` is usable, which the schema only partially expresses ('Not used with a GreenlandAI agent key').

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

Purpose4/5

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

Frames a specific question ('Can you afford the next call?') and names the inputs and exact return fields, so the agent knows this is a pre-flight affordability check rather than a plain balance read. It is distinguishable from joules_balance/billing_quote by intent, though no sibling is named explicitly.

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?

'Can you afford the next call?' plus 'Give a planned `cost`' establishes the usage context: run this before committing to a paid call. It does not name alternatives (joules_balance, billing_quote) or say when not to use it, so it stops short of full routing guidance.

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