execute
ChatGPTExecute a GraphQL operation. Use the
introspect tool to get information about the GraphQL schema. Always use the schema to create operations - do not try arbitrary operations. If available, first use the validate tool to validate operations. DO NOT try to execute introspection queries. Hint: Execution Rules Sequence: helloMCP → introspect → validate → execute. helloMCP supplies the reference date and display currency, introspect the field/argument/enum names, and validate catches schema errors before a query runs. Field and type names that were not read from introspect fail at validate or execute. PRE-FLIGHT CHECKLIST — 4 rules validate can't catch (they fail only at execute) 1. Series (`costs`/`aiCosts`/`saasCosts`/`k8sCosts`): pass BOTH `groupBy` and `xAxis` (never category). 2. `limit`: only `10/20/30/50/100`, or `-1` for all/total — never 0 or arbitrary ints; always set it (default 20). REQUIRED for *TopEntries AND costVariances (no backend default → omitting fails with Unrecognized name: undefined). 3. `options` (cloud/resource): `discount`/`refund`/`tax` + exactly one of `default`/`net`/`amortized`/`net_amortized` — the baseline is ["default","discount","refund","tax"]; swap only the variant when the user asks (SaaS / GenAI / agent / code-assist: []; K8s cost / datacenter: ["default"]). Other strings are silently dropped. 4. Introspect `Filter` before building one — it's flat typed fields, no json wrapper. Two totals that are computed, not read - Cost-variance net = (this-period total) − (prior-period total). Summing the per-group deltas is approximate — they are rounded and drop unattributed rows. - Coverage is ONE month's row: Usage Hours is the covered (ri+sp) hours, not total hours. STEP 0 — Session context: helloMCP is the source of the current date/time and the tenant's display currency. helloMCP.datetime is the reference point for every relative date ("last 7 days", "this month"); the server clock and the tenant's date are not otherwise knowable here. helloMCP.currency (e.g. "USD", "EUR") is the currency every cost figure in the session is denominated in, and both values hold for the whole session. helloMCP returns { name, datetime, currency, settings, tagPolicies }. It does NOT return default cost options — for standard cloud cost + resources use the fixed baseline ["default","discount","refund","tax"] (variant default = actual/blended on-demand, NOT amortized); only when the user asks for a different variant, swap the single variant flag per the Cost Variant Selection rule (e.g. ["amortized","discount","refund","tax"]). There is NO field echoing back which options ran: CostTopEntriesResponse returns only topEntries and total, so the variant a figure used is knowable only from the request that produced it. Also cache helloMCP.settings — the tenant's saved defaults, each an array of {id,name,scope,...} groups, that feed your thresholds (anomaly) and savings-floor inputs: - settings["cost-anomalies"] → the tenant's anomaly threshold ALREADY in the canonical GROUPED shape [{id,name,scope,thresholds:[{type,value,relationship}]}]. AnomalyOption.thresholds is OPTIONAL and the server applies NO default — it filters by EXACTLY what you pass, so omitting it returns EVERY anomaly (sub-dollar noise included). So pass one in almost every case: for "the configured / my usual threshold" (the common case) pass this VERBATIM as AnomalyOption.thresholds; to override, keep that exact grouped shape and change only the inner rule values; only OMIT thresholds when the user explicitly wants ALL anomalies. NEVER flatten it to [{type,value}] (without the wrapping {id,name,scope,thresholds:[...]} group the server can't key on it and the filter is dropped). A settings group may carry an alerts array; strip it, only {id,name,scope,thresholds} is read. - settings["savings-thresholds"] → the tenant's savings floor [{id,name,scope,threshold:<number>}] — pass it as the thresholds for recommendation/savings …




