Skip to main content
Glama
This connector has been deprecated

Duplicate listing. This connector has been replaced by ai.screwtape/screwtape.

Budget Ledger

budget_ledger
Idempotent

Budget Ledger: atomically reserves reported USD spend across a run and its sub-agents. Returns allow/warn/block, remaining budget, retry storms and spend velocity. Call judge first, then reserve immediately before spending; honor block. This is cooperative accounting, not payment enforcement. Root cap and parent are immutable. Children inherit the root cap (send the same cap). event_id is the authoritative idempotency key; a custom HTTP key cannot override it. New event_id per attempted action; same event_id and body replays without reserving twice. No refunds or cap resets. Warn reservations count as spend. Limits: USD, six decimals, cap at most 1000000. Three matching actions in 60 seconds allowed; fourth blocked. Velocity warning at ten attempts/minute or more than 25% of cap/minute; 80% usage warns. Use action to distinguish operations at a merchant. Stored: IDs, keyed fingerprints and amounts, not raw action/merchant. Records persist until the API key is deleted; keyless records have no automatic expiry. $0.002 per call; shared 3 free calls per UTC day without a key (daily private IP namespace), plus 10/day with a free key. Anonymous scopes rotate daily; use a key for a persistent ledger/chain. Send the same Bearer key plus a payment header to keep the same ledger/chain after the allowance runs out.

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": {
      "run_id": "<run_id>",
      "event_id": "<event_id>",
      "amount": "<amount>",
      "cap": "<cap>",
      "merchant": "<merchant>"
    },
    "name": "budget_ledger"
  }
}

Input Schema

NameRequiredDescriptionDefault
capYes
actionNo
amountYes
run_idYes
currencyNo
event_idYes
merchantYes
parent_run_idNo

Output Schema

NameRequiredDescriptionDefault
spentYes
run_idYes
reasonsYes
decisionYes
event_idNo
replayedNo
reservedYes
request_idNo
retry_countNo
root_run_idYes
remaining_budgetYes
velocity_per_minuteNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare non-read-only, idempotent, and non-destructive behavior, and the description adds substantial context beyond them: atomic reservation, warn reservations counting as spend, no refunds or cap resets, retry-storm limits, velocity warnings, persistence rules, and pricing. It does not contradict the annotations.

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

Conciseness4/5

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

The definition is front-loaded with purpose and call order, and most sentences carry operational constraints rather than filler. It is still a dense paragraph with pricing, auth, storage, and rate-limit details packed together, so it could be better structured.

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?

Given the tool's complexity, eight parameters, weak schema descriptions, and existing output schema, the description covers the behavior an agent needs: idempotency, block handling, limits, inheritance, persistence, and auth/pricing. Return values need not be explained in depth because an output schema exists, though they are also summarized.

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?

With 0% schema description coverage, the description carries the burden of explaining parameter meaning. It clarifies event_id as the authoritative idempotency key, cap inheritance for children, USD six-decimal limits, and action's role in distinguishing merchant operations, though run_id, parent_run_id, merchant length constraints, and currency const are left mostly to the schema.

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 states a specific verb and resource: atomically reserves reported USD spend in a budget ledger across a run and sub-agents. It also distinguishes the tool from payment enforcement and explains that it returns allow/warn/block outcomes, so an agent can identify its role without opening the schema.

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?

It gives clear usage context: call judge first, then reserve immediately before spending, and honor a block result. It does not explicitly compare against all sibling tools or state when not to use this tool, but the prerequisite and operational ordering are clear.

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