Skip to main content
Glama

Break down spend by region

cloudcdn_cost
Read-onlyIdempotent

Estimate CloudCDN traffic costs over a 1–30 day window, returning per-region and total USD figures for FinOps questions and reporting.

Instructions

Estimate what CloudCDN traffic cost over the last N days, per region and in total, for FinOps questions. For energy and emissions use cloudcdn_carbon, which reads the same usage; for traffic without prices use cloudcdn_insights_summary. Asks GET /api/billing/usage for per-region requests and bytes first; cloudcdn.pro has no such endpoint today and answers 404, so the usage normally comes from the account totals of GET /api/core/statistics (Summary.TotalRequests and Summary.TotalBandwidth) as a single region named "global", with no split by region; projected=true skips the billing call. With zone set, the statistics narrow only the request count to that zone, and bandwidth stays account-wide. Prices are always computed locally from the published rate card, $0.20 per million requests plus $0.05 per GB. Returns JSON: days, mode ("actual" from billing usage, "projected" from statistics), regions (each with region, requests, bandwidth_gb and cost_usd, rounded to cents) and total_usd. When the billing call is not answered with 2xx, a line naming its HTTP status follows the JSON. Read-only. Fails: no CLOUDCDN_ACCOUNT_KEY, a JSON-RPC error; days outside 1..30, exit code 64; statistics without those totals, exit code 69, instead of reporting zero usage.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "cloudcdn_cost"
  }
}

Input Schema

NameRequiredDescriptionDefault
daysNoLook-back window in days, 1 to 30. Default 7.
zoneNoZone to restrict usage to, usually a project from cloudcdn_assets, e.g. "acme"; passed to both endpoints as is (the statistics narrow only requests). Omit for every zone.
projectedNotrue to skip /api/billing/usage and project from /api/core/statistics. Default false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.0.24
    • addedInput schema / properties / days / description
      Added value: +"Look-back window in days, 1 to 30. Default 7."
    • addedInput schema / properties / projected / description
      Added value: +"true to skip /api/billing/usage and project from /api/core/statistics. Default false."
    • addedInput schema / properties / zone / description
      Added value: +"Zone to restrict usage to, usually a project from cloudcdn_assets, e.g. \"acme\"; passed to both endpoints as is (the statistics narrow only requests). Omit for every zone."
  2. First observedv0.0.23

TDQS

A4.1/5.0
Behavior3/5

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

The description goes well beyond the readOnlyHint/idempotentHint annotations: it discloses the 404 fallback to GET /api/core/statistics, that missing per-region data collapses to a single "global" region, the local rate card, that a non-2xx billing response appends an HTTP status line after the JSON, and specific failure modes with exit codes 64 and 69. However, some of this prose restates annotation-implied facts ("Read-only") and the description does not characterize latency, rate limits, or auth mechanics beyond the missing CLOUDCDN_ACCOUNT_KEY case, so it is strong but not exhaustive.

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 and the sibling routing come first, followed by endpoint behavior, pricing, return shape, and failure modes in a logical order with no filler sentences. The middle paragraph is a dense run-on bundling the 404 fallback, the global-region degradation, and zone semantics into one breath, which costs a little readability on an otherwise tight definition.

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 carries the return contract and does so thoroughly: fields days, mode, regions (region, requests, bandwidth_gb, cost_usd), total_usd, rounding to cents, and the appended status line on billing failure. Failure conditions are enumerated with exit codes. The only gap is that request/bandwidth units and typical magnitude or latency expectations are not described.

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 all three parameters are already documented with defaults and ranges. The description reinforces semantics that matter operationally – zone narrows only the request count while bandwidth stays account-wide, and projected=true skips the billing call – but adds little that the schema text does not already state, so the baseline 3 applies.

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?

Opens with a specific verb and resource: "Estimate what CloudCDN traffic cost over the last N days, per region and in total." It immediately scopes itself to FinOps questions and names the two siblings whose jobs differ (cloudcdn_carbon for emissions, cloudcdn_insights_summary for unpriced traffic), so an agent can choose without opening schemas.

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

Usage Guidelines5/5

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

Explicit routing is given: use this for cost/FinOps, cloudcdn_carbon for energy and emissions, cloudcdn_insights_summary for traffic without prices. It also explains when to set projected=true (skip the billing call) and what zone does versus omitting it, which is genuine when-to-use guidance rather than implied context.

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