Skip to main content
Glama
zhaoyue722

LLM Usage & Cost Tracker

record_usage

Record a single LLM API call with token counts and automatically compute cost. Use request_id to prevent duplicate entries.

Instructions

Record a single LLM API call with token counts.

Cost is computed automatically from the pricing table at insert time. request_id enables idempotent recording — replaying a log file won't double-count.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tagsNo
modelYes
projectNo
successNo
metadataNo
providerYes
error_typeNo
request_idNo
duration_msNo
input_tokensYes
output_tokensYes
cache_read_tokensNo
cache_write_tokensNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
warningYes
cost_usdYes
Behavior3/5

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

Without annotations, the description discloses automatic cost computation and idempotency. However, it does not describe side effects such as failure handling, whether it updates existing records, or other behavioral details.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very short and front-loaded, but its brevity sacrifices essential detail, especially parameter descriptions. It is not as helpful as it could be.

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?

Given the tool's 13 parameters and the presence of an output schema (not detailed), the description is incomplete. It lacks parameter explanations and output behavior, making it insufficient for correct invocation.

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

Parameters1/5

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

The description provides no explanation for any of the 13 parameters (4 required). With 0% schema description coverage, the tool fails to help the agent understand parameter meaning or usage.

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 clearly states the tool records a single LLM API call with token counts, and mentions automatic cost computation and idempotency. It distinguishes from sibling tools like query_spend or usage_summary, which are read-oriented.

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 implies usage for recording API calls, but does not explicitly state when not to use it or suggest alternative tools. The mention of idempotent recording via request_id provides some guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zhaoyue722/llm-usage-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server