Skip to main content
Glama

explain_cost_change

Read-onlyIdempotent

Explain a specific cost change: which timeline events line up with it, how strongly, and how much of the move Plutus could account for. Ask this about any point on a cost chart — it is not limited to anomalies the detector flagged (use list_anomalies for those; each already carries the same explanation).

RENDER explanation.sentences AS WRITTEN. They are generated under a strict discipline and are the only phrasing this data supports: Plutus reports temporal and dimensional evidence, never causation. Each candidate carries a claim of "coincides" (temporal proximity only — the common case), "consistent_with" (proximity plus a confirmed link between that event source and this cost entity) or "accounts_for" (a known dollar amount that matches the move). Do not upgrade one to another, do not say an event "caused" or "led to" the change, and do not merge several candidates into a single narrative.

Three separate numbers, never interchangeable: change_evidence is how sure we are a real change-point exists at all; attribution_completeness is what fraction of the move was localized to a specific part of the bill (a low value means "we do not know what this spend is yet", which is NOT the same as "nothing explains it"); p_cause is per candidate, and sums with p_unknown to 1. tier: "unknown" means we looked and found nothing that lines up — say that, rather than reaching for the top-ranked candidate anyway. Confidence is capped at 0.60 by design; there is no "high" tier today.

Body: dimension + value name the slice (e.g. service=AmazonEC2), optional cost_source_id narrows it, and exactly one of day or range says when. A range is narrowed to the single biggest-moving day inside it, reported as explained_day. Mirrors POST /api/accounts/:accountId/cost-changes/explain.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dayNoYYYY-MM-DD — the day to explain
rangeNoHalf-open YYYY-MM-DD range; narrowed to its biggest-moving day
valueYesThe dimension value that moved, e.g. "AmazonEC2"
dimensionYesWhich dimension names the slice
cost_source_idNoNarrow to one cost source, e.g. "aws"

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already establish a read-only, idempotent, non-destructive profile, and the description goes well beyond them: it discloses the confidence cap (0.60), the absence of a 'high' tier, the meaning of tier:'unknown', the mutual exclusivity of p_cause/p_unknown, and the no-causation reporting discipline. The only gap is it doesn't describe pagination or response envelope shape, though it does cover the semantic fields.

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. The body is dense and every paragraph carries a distinct semantic payload (render discipline, the three numbers, tier semantics, request shape). It runs long, but with no output schema the verbosity is largely load-bearing rather than filler.

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?

With no output schema, the description must carry the full return-value burden — and it does, defining change_evidence, attribution_completeness, p_cause/p_unknown, tier, explained_day, and explanation.sentences, plus the API endpoint it mirrors. Nothing an agent needs to call or interpret this tool is missing.

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 100%, so a 3 is the floor, but the description adds real meaning: 'dimension + value name the slice, optional cost_source_id narrows it, and exactly one of day or range says when' — the mutual-exclusivity constraint is not stated in the schema. It also explains the range→explained_day narrowing behavior, which the schema only hints at.

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?

States a specific verb and resource ('Explain a specific cost change') and immediately enumerates the three things it returns: which timeline events line up, how strongly, and how much Plutus could account for. It also distinguishes itself from the sibling list_anomalies by scope ('any point on a cost chart — not limited to anomalies the detector flagged').

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?

Explicitly says when to use it ('ask this about any point on a cost chart') and names the alternative for the flagged-anomaly case ('use list_anomalies for those; each already carries the same explanation'). It even governs downstream behavior with 'RENDER explanation.sentences AS WRITTEN', which is strong usage guidance.

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.

Resources