Skip to main content
Glama

Agent Billing Primitives (Dirtsmith)

agent_spend_ledger

agent_spend_ledger

Hosted shared spend ledger for agents: set a budget ceiling, atomically reserve before paying (never overspends, even with many agents at once), then settle or release. Idempotent. Share state by namespace

Input Schema

NameRequiredDescriptionDefault
memoNo
ttl_sNo
actionYes
sourceNo
budget_idYes
caller_idNodemo_caller
namespaceYes
limit_microsNo
amount_microsNo
reservation_idNo
idempotency_keyYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.3/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, and it does disclose real behavior: atomic pre-payment reservation, no overspend under concurrency, idempotency, and namespace-shared state. It omits permission/auth requirements, what happens when a reservation expires (ttl_s), and what an error or insufficient-budget outcome looks like.

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?

Tight and front-loaded: the lifecycle is in the first sentence, with atomicity, idempotency, and namespacing as follow-ups. The final fragment 'Share state by namespace' is telegraphic at the cost of a little clarity, but nothing is padded.

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

Completeness2/5

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

For an 11-parameter, action-multiplexed tool with no annotations and no output schema, the description should at minimum map actions to their required parameters (e.g., reserve needs amount_micros; settle needs reservation_id) and sketch return values such as a reservation id. Neither is present, leaving the caller to reverse-engineer the call shape from the schema alone.

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

Parameters3/5

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

Schema description coverage is 0% across 11 parameters, so the description must compensate. It maps loosely onto a few of them (budget ceiling, reservation, namespace, idempotency) but never explains limit_micros vs amount_micros, ttl_s, memo, caller_id, source, or reservation_id — and critically never says which parameters are required for which of the five actions.

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?

The description states a specific resource (a hosted shared spend ledger) and its lifecycle verbs (set a budget ceiling, reserve, settle, release), so an agent knows exactly what the tool does. It does not differentiate itself from siblings agent_lease_lock or mcp_usage_metering, which look adjacent in purpose, so it stops short of a 5.

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

Usage Guidelines3/5

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

The lifecycle order (set budget → reserve before paying → settle or release) implies when each action applies, which is useful implied guidance. However, there is no explicit when-to-use versus agent_lease_lock, no statement of prerequisites or ordering constraints, and the 'status' action is never mentioned at all.

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.