Skip to main content
Glama

Record usage

record_usage

Record a usage event. Idempotent on event_id (safe to retry — never double-billed). outcome is 'ok' or 'error' and feeds the SLA report.

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": {
      "meter_id": "<meter_id>",
      "event_id": "<event_id>",
      "quantity": "<quantity>"
    },
    "name": "record_usage"
  }
}

Input Schema

NameRequiredDescriptionDefault
outcomeNook or error. Feeds the SLA report.ok
event_idYesYour id for this usage event; recording it again never double-bills.
metadataNoOptional. Extra key-value data stored with the record.
meter_idYesThe meter id returned by create_meter.
quantityYesUnits used in this event.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / additionalProperties
      Added value: +false
  2. Changed5 schema fields changed
    • addedInput schema / properties / event_id / description
      Added value: +"Your id for this usage event; recording it again never double-bills."
    • addedInput schema / properties / metadata / description
      Added value: +"Optional. Extra key-value data stored with the record."
    • addedInput schema / properties / meter_id / description
      Added value: +"The meter id returned by create_meter."
    • addedInput schema / properties / outcome / description
      Added value: +"ok or error. Feeds the SLA report."
    • addedInput schema / properties / quantity / description
      Added value: +"Units used in this event."
  3. First observed

TDQS

B3/5.0
Behavior1/5

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

The description asserts "Idempotent on event_id (safe to retry — never double-billed)," while the annotations declare idempotentHint=false, which tells an agent repeated identical calls do have additional effect. This is a direct conflict on the single most consequential behavioral trait for a billing tool, so the description actively misleads rather than merely omitting context.

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 tightly packed sentences with no filler, and the core action plus the idempotency guarantee are front-loaded. The outcome/'ok' or 'error'/SLA clause is compact and earns its place.

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?

With an output schema present and full parameter documentation, the description only needs to cover behavior and usage, which it partly does via the retry and SLA notes. But for a non-read-only billing mutation it omits error handling, permission expectations, and — critically — states an idempotency guarantee that conflicts with the annotations, leaving the agent with a distorted picture.

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%, so every parameter (event_id, meter_id, quantity, outcome, metadata) is already documented in the schema, including the same idempotency and SLA notes. The description adds no parameter meaning beyond what the schema states, so the 3 baseline applies.

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?

"Record a usage event" names a specific verb and resource, and the idempotency/outcome details make it clearly distinct from read-side siblings like usage_summary and usage_timeseries. It stops short of explicitly naming an alternative, but the purpose is unambiguous.

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 description supplies real operational guidance — retrying is safe because of idempotency on event_id — which tells the agent how to behave after a failure. It does not, however, say when to call this versus related tools (usage_summary, list_events) or mention prerequisites such as needing a meter_id from create_meter, so guidance is implied rather than explicit.

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.