Skip to main content
Glama

LLM Pricing

record_usage

Record actual token usage for a completed LLM call. Cost is computed server-side from current pricing, never trusted from the caller — this is the 'actual spend' counterpart to estimate_cost's hypothetical numbers. Optionally scope to an org_id for per-org spend tracking. Resubmitting the same request_id for the same org is a no-op. Use when the user wants to log or track real LLM spend, not just estimate it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
org_idNoOptional organisation ID to attribute this usage to
model_nameYesName of the LLM model that was called
request_idNoOptional idempotency key — resubmitting the same value is a no-op
session_idNoOptional session ID to tag this event with, so it can later be grouped and retrieved via analyze_session_usage — e.g. a bounded burst of calls like a coding-agent run or a chat session
occurred_atNoUnix timestamp when the call happened (default: now)
input_tokensYesNumber of input tokens actually used
output_tokensYesNumber of output tokens actually used

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description usefully discloses that cost is computed server-side and never trusted from the caller, plus that resubmitting the same request_id is a no-op — non-obvious behavioral traits. It omits auth requirements and whether a mutation like this is reversible or returns the computed cost, leaving a gap.

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?

Front-loaded with the core action and dense with useful detail across four sentences. Minor redundancy ('not just estimate it' echoes the earlier estimate_cost contrast), but nothing is wasted.

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

Completeness4/5

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

Given seven parameters with no annotations and no output schema, the description covers the important behavior (server-side cost, idempotency, org scoping). The return value — presumably the recorded usage with computed cost — is not described, which is the main remaining 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 coverage is 100%, so the schema already documents all seven parameters including org_id scoping and request_id idempotency. The description's mention of org_id scoping largely restates the schema, so baseline 3 applies.

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?

States a specific verb and resource ('Record actual token usage for a completed LLM call') and explicitly positions itself as the 'actual spend' counterpart to estimate_cost, distinguishing it from a sibling tool by name.

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

Usage Guidelines5/5

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

Explicitly states when to use it ('when the user wants to log or track real LLM spend, not just estimate it') and names the alternative (estimate_cost) with the condition that selects it.

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.