Skip to main content
Glama

AI Code Security Gate

Record Agent Spending

spend_record

Authorize AND record spending against the agent's budget. Costs 1¢ per attempt.

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": {
      "agent_id": "<agent_id>",
      "amount_cents": "<amount_cents>"
    },
    "name": "spend_record"
  }
}

Input Schema

NameRequiredDescriptionDefault
reasonNo
api_keyNo
agent_idYes
amount_centsYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.9/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, idempotentHint=false, openWorldHint=false and destructiveHint=false, so the safety profile is covered. The description adds genuinely useful context beyond that: every attempt incurs a 1¢ charge, which combined with idempotentHint=false warns that retries are billable. It still omits what happens on insufficient budget, whether authorization is a gate that can fail, and whether an api_key is required for authentication.

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 short sentences with the primary effect front-loaded and the cost caveat immediately after — no filler or redundancy. It is efficient, though the extreme brevity leaves the second sentence carrying more weight than the first.

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?

An output schema exists, so return values need not be described. However, for a non-idempotent, non-read-only budget mutation that takes an authentication parameter and charges per call, the description should address auth needs and failure behavior around budget exhaustion. Neither is covered, leaving an agent without enough to call it confidently.

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

Parameters2/5

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

Schema description coverage is 0% across four parameters, so the schema gives no semantic help and the description must compensate — but it does not. The authentication parameter 'api_key', the 'reason' field, and the unit/constraints of 'amount_cents' are undocumented in both places; only 'agent's budget' loosely implies what 'agent_id' means.

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 names a specific verb pair and resource: 'Authorize AND record spending against the agent's budget.' That is far more specific than the name 'spend_record' alone and signals a two-part effect (authorize, then persist). It stops short of 5 because it does not distinguish its role from budget-reading or escrow-style siblings in the definition text itself.

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 explicit when-to-use or when-not-to-use guidance, and no stated preconditions such as needing a funded budget or a valid key. The only guidance-adjacent content is 'Costs 1¢ per attempt,' which is a cost caveat rather than a routing rule. An agent is left to infer that this is the call to make whenever budget must be debited.

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.