Skip to main content
Glama

llm_update_usage

Update cached Claude usage from API responses to replace token estimates with real budget pressure metrics for cost-aware model routing.

Instructions

Update cached Claude usage from the JSON API response.

Call this with the result from browser_evaluate(FETCH_USAGE_JS).
Accepts the full JSON object from the claude.ai internal API.

The cached data is used by llm_classify for real budget pressure
instead of token-based estimates.

Args:
    data: JSON response from the claude.ai usage API (via browser_evaluate).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses the caching side effect and data flow (claude.ai API → cache → llm_classify). However, it omits mutation details (destructive overwrite vs merge), validation behavior, error handling, or idempotency characteristics.

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?

Information is front-loaded and generally efficient. The embedded 'Args:' section is slightly awkward structurally but functional. Four sentences cover purpose, invocation method, data format, and downstream usage without excessive verbosity.

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?

Adequate for a single-parameter cache update tool where output schema exists (so return values need not be described). Compensates for poor schema coverage. Could improve by mentioning authentication requirements, validation constraints, or error conditions given the internal API dependency.

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

Parameters4/5

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

The schema has 0% description coverage (only 'Data' as title). The description compensates effectively by specifying the parameter accepts 'the full JSON object from the claude.ai internal API' and clarifying it comes via browser_evaluate(FETCH_USAGE_JS). Could improve by mentioning required fields within the JSON.

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?

Clearly states it updates cached Claude usage from a JSON API response, with specific verb and resource. Mentions integration with browser_evaluate and llm_classify. However, it does not distinguish from similar siblings like llm_refresh_claude_usage or llm_check_usage.

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?

Provides explicit invocation context: 'Call this with the result from browser_evaluate(FETCH_USAGE_JS)'. Explains the downstream consumer (llm_classify for budget pressure). Missing explicit when-not-to-use guidance or comparison to alternative usage tools like llm_refresh_claude_usage.

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/ypollak2/llm-router'

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