Skip to main content
Glama

cost_per_token

Read-only

Derives $/1M-token cost from live vLLM throughput and GPU hourly rate; returns insufficient-data forecast when throughput metrics are unavailable.

Instructions

[READ] Attribute a $/1M-token unit cost from live vLLM throughput.

Multiplies the current generation-throughput gauge by the supplied GPU hourly cost to derive the cost of serving 1M tokens; degrades to an insufficient-data forecast when no throughput metric is present.

Args: gpu_hourly_cost: Hourly cost of a single GPU (e.g. cloud on-demand rate). num_gpus: Number of GPUs backing the deployment; defaults to 1. target: Inference target name from config; omit for the default.

Input Schema

NameRequiredDescriptionDefault
targetNo
num_gpusNo
gpu_hourly_costYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

A3.6/5.0
Behavior4/5

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

The [READ] tag is consistent with readOnlyHint=true. Beyond annotations, the description discloses the computation model (throughput gauge x GPU hourly cost) and, importantly, the degradation behavior when no throughput metric exists ('insufficient-data forecast'), which the annotations do not convey.

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?

Purpose is front-loaded in the first sentence, followed by mechanism, degradation behavior, and a clean Args block. Slightly verbose in the middle sentence, but every clause adds information an agent needs.

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?

With no output schema, the description still names the returned concept (cost of serving 1M tokens) and the fallback state, and it documents all three parameters. It stops short of describing the actual response shape or units in the return payload, a minor gap for a computed read tool.

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?

Schema coverage is 0%, so the description must carry the parameter burden, and it does: gpu_hourly_cost is defined with a concrete example (cloud on-demand rate), num_gpus is described as the backing GPU count with a default, and target is explained as a config name that can be omitted for the default.

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 gives a specific verb+resource: it derives a $/1M-token unit cost from live vLLM throughput, and even explains the multiplication mechanism. It is unambiguous about what the tool produces, though it never explicitly distinguishes itself from the metric-oriented siblings (request_metrics, gpu_utilization) beyond being the cost-attribution tool.

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 when-to-use, when-not-to-use, or alternative-tool guidance. With ~40 siblings in the same server, the description leaves the agent to infer that this is the cost tool purely from its name and purpose statement.

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