Skip to main content
Glama

estimate_cost

Estimate the price of an operation

Returns the exact USD price this API would charge for an operation on an input of the given size, without fetching or processing anything. Free. Use it before paying: send X-Max-Cost-USD on the real request to have the API refuse (412) instead of charging more than you allowed. The list price is returned even when the request could end up free (free tier, or a compress that does not shrink the file).

Responses:

200: Successful Response (Success Response) Content-Type: application/json

Example Response:

{
  "operation": "Operation",
  "price_usd": 1.0,
  "base_usd": 1.0,
  "surcharges_usd": {},
  "size_multiplier": 1.0,
  "within_free_tier": true,
  "free_tier_remaining": 1,
  "currency": "Currency",
  "network": "Network"
}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatNoRequested output format; only avif changes the price.
operationYesOperation to price. One of resize, compress, convert, crop, optimize_for_vision, optimize_generated, pipeline. analyze is always free.
operationsNoFor pipeline only: the ordered operations, each {type, format?}. Volume discount applies at 3+ operations.
input_bytesYesSize of the input image in bytes. Get it from analyze_image (free) if you do not know it.
quality_targetNoWhether the request will use quality_target (SSIM search surcharge).

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It explicitly states the tool is free, does not fetch or process anything, returns exact USD price, and explains behavior for free tier and compress operations that do not shrink the file. The response example further enriches transparency by showing fields like free_tier_remaining. It does not contradict any provided metadata.

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 description is relatively concise, with a few clear sentences followed by a detailed example response. While the example response is lengthy, it adds value by clarifying the return structure. Overall, the description is well-structured and avoids unnecessary verbosity, though the example could be trimmed slightly.

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

Completeness5/5

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

Given the tool's moderate complexity (5 parameters, 2 required, nested objects) and no output schema, the description is highly complete. It explains when to use it, how to use it with headers, behavior under free tier and compress, and includes a full response example with all fields. Nothing essential is missing for an AI agent to understand and invoke the tool correctly.

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 description coverage is 100%, so baseline is 3. The description adds little beyond the schema: it mentions that only 'avif' changes price for format, which is already in the schema. No additional parameter context or examples are provided that significantly enhance understanding beyond what the schema already communicates.

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 description clearly states the tool estimates the price of an operation, using a specific verb ('Estimate') and resource ('price of an operation'). It distinguishes itself from sibling processing tools (e.g., compress_image, convert_image) by being the only cost estimation tool, and explicitly mentions it does not fetch or process anything.

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?

The description provides clear guidance on when to use: 'Use it before paying' and explains how to integrate with X-Max-Cost-USD to limit costs. It also notes that the list price is returned even if the request would be free. However, it does not explicitly mention situations where this tool should not be used or suggest alternatives, though siblings are distinct enough.

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.

TDQS

A3.9/5.0
Disambiguation3/5

Most tools are distinct, but compress_image, convert_image, and optimize_generated_image overlap heavily: all re-encode images with format and quality options. The descriptions clarify intent, yet an agent could still struggle to pick between compressing, converting, and optimizing in some cases.

Naming Consistency4/5

The set mostly follows a verb_noun pattern (analyze_image, compress_image, crop_image, resize_image). Minor deviations include image_pipeline, which is a noun phrase, and optimize_for_vision/optimize_generated_image, which use longer prepositional forms, but the overall pattern is predictable.

Tool Count5/5

Ten tools is well within the ideal range for an image-processing server. Each tool serves a meaningful purpose, and the count feels neither bloated nor thin.

Completeness4/5

Core image operations are well covered: analyze, resize, crop, convert, compress, pipeline, plus cost/format introspection. Minor gaps like rotate/flip or explicit metadata editing are absent, but agents can accomplish most workflows with the existing surface.

Resources