Skip to main content
Glama

Machine Utility Foundry (x402 + ICP Trust & Safety Oracles)

stateful_budget_guard_icp

[x402 Paid: $0.015 Base USDC] Enforce payer-isolated stateful shared spending caps and atomic nonce replay protection across multi-agent swarms on Internet Computer (ICP).

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": {
      "vaultId": "<vaultId>",
      "agentId": "<agentId>",
      "nonce": "<nonce>",
      "action": "<action>",
      "amountMicroUsd": "<amountMicroUsd>",
      "budgetCapMicroUsd": "<budgetCapMicroUsd>"
    },
    "name": "stateful_budget_guard_icp"
  }
}

Input Schema

NameRequiredDescriptionDefault
nonceYesUnique idempotency/replay-protection nonce for this spend attempt (7-day on-chain TTL).
actionYesShort action label describing the intended expenditure (e.g. x402_api_call).
agentIdYesIdentifier of the autonomous agent worker requesting spend approval.
vaultIdYesLogical budget vault identifier isolated under the verified x402 payer address (1..64 chars).
amountMicroUsdYesRequested spend amount in micro-USD (1 USD = 1,000,000 micro-USD).
budgetCapMicroUsdYesMaximum cumulative spending cap for this vault in micro-USD.
maxSingleMicroUsdNoOptional per-transaction spending ceiling in micro-USD.

Output Schema

NameRequiredDescriptionDefault
nonceYes
reasonYes
vaultIdYes
decisionYes
onChainProofNo
decisionSha256Yes
opaqueVaultKeyYes
payerNamespaceYes
replayDetectedYes
remainingMicroUsdYes
stateAnchoredOnChainYes
cumulativeSpentMicroUsdYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.2/5.0
Behavior3/5

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

The description adds genuinely useful context beyond the annotations: the $0.015 Base USDC x402 charge, payer isolation, and atomicity. However, for a non-read-only, open-world, non-idempotent mutation it never states what happens on denial (rejected vs. partially recorded), whether the fee is charged on a failed attempt, or that the 7-day nonce TTL blocks retries. There is also mild tension between the claimed 'replay protection/idempotency nonce' and idempotentHint=false, though these are reconcilable (duplicate nonces error rather than being idempotent).

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?

Two compact clauses with the paid-access notice front-loaded, which is the most decision-relevant fact for an agent. No filler, though the dense noun stacking ('payer-isolated stateful shared spending caps') costs a little readability.

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

Completeness3/5

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

An output schema exists, so return values need not be explained, and annotations cover the safety profile. What is missing is the stateful contract itself: whether a successful call decrements the vault balance, whether the same agentId can run concurrent spends, and how the cap is enforced relative to the requested amount. For a paid, stateful mutation this leaves a meaningful gap.

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 100%, including nonce TTL, micro-USD units, and the optional per-transaction ceiling, so the schema already carries parameter meaning. The description adds only the conceptual framing of payer-scoped vaults and does not clarify interactions such as how budgetCapMicroUsd is treated on repeat calls or how maxSingleMicroUsd combines with the cap.

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 gives a specific verb ('Enforce') plus the resource ('payer-isolated stateful shared spending caps and atomic nonce replay protection'), and names the platform (ICP), which distinguishes it from the sibling guard_evm_preflight_base. What remains fuzzy is whether the call merely evaluates a spend or actually commits/reserves budget, so an agent cannot fully tell the operation's outcome from the sentence alone.

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

Usage Guidelines2/5

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

There is no when-to-use guidance, no prerequisites (e.g. payer auth must be verified first), and no named alternative. 'Across multi-agent swarms' only implies the setting; it does not tell the agent which of the sibling guard/attest tools to pick or when not to call this one.

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