Skip to main content
Glama

Estimate a Relay cost

estimate_cost
Read-onlyIdempotent

Estimates the USD cost of an AI model call before you run it. Pass the model and usage fields to get a per-call price estimate from the price list, not an invoice.

Instructions

Estimates the USD cost of a call from the price list (with a credential your account's view: its tier and grants; public otherwise): an estimate, not an invoice (the bill uses provider-reported usage and any custom pricing on your account). Pass only the usage fields the model's billing_type (see get_model or get_pricing) reads: per_token: input_tokens, output_tokens, cached_input_tokens; per_image: image_count, resolution_tier; per_second_video: duration_seconds, quality_mode, sound; per_second_audio: duration_seconds; per_character: character_count; per_media_token: media_input_tokens, media_output_tokens. Add store_output / retention / file_count for storage fees.

Input Schema

NameRequiredDescriptionDefault
modelYesExact model name, e.g. KlingTeam/v3-T2V.
usageYesWhat the call uses; only the fields of the model's billing type matter.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.8

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnly/openWorld/idempotent, so the bar is lower, yet the description still adds real context: the estimate may diverge from the invoice due to provider-reported usage and account-specific custom pricing, and pricing depends on the caller's tier and grants (public otherwise). It also documents defaults and that relay1h and provider storage are free. Missing: the returned structure.

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?

The estimate-vs-invoice caveat is front-loaded within the first sentence and there is no filler; however, the heavy nested-parenthesis construction and the long comma-run of billing-type field lists make it dense to parse.

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 no output schema, the description carries full responsibility for describing the return value, and it only says it 'estimates the USD cost' without indicating a total vs. an itemized breakdown, currency/rounding, or what happens for an unpriced model or unsupported billing_type. Inputs are thoroughly covered, so the omission is on the output side only.

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 per-field descriptions already carry the definitions; the description's contribution is organizing fields by billing_type and instructing the agent to pass only the relevant subset, which is useful but largely restates the schema's existing 'per_token:'/'per_second_video:' prefixes. It adds the storage-fee trio (store_output/retention/file_count) grouping but little beyond that.

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?

The opening clause gives a specific verb (estimates) and resource (USD cost of a call from the price list), which is clearly distinct from get_pricing (returns the list) and get_usage (actual billed usage). An agent can distinguish it from every sibling without reading the schema.

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

Usage Guidelines4/5

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

It explicitly directs the agent to consult get_model or get_pricing to find the model's billing_type, and warns off misuse by stating the result is an estimate, not an invoice, with the bill driven by provider-reported usage. It does not state a hard when-not (e.g., 'do not use to reconcile spend, use get_usage'), so it stops short of full alternative routing.

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