suggest_groupby
Suggest dimensions for grouping costs, ranked by their contribution, based on an optional filterCel (CEL). Call this when the user asks "what should I look at?" or when you need columns for query or find_cost_change_factors. Use datePreset for preset ranges and from/to for custom ranges. Omit compare for current-window ranking. Pass compare ({} auto-derives, or { from, to }) when the user asks what changed — then pass 2–4 of the returned column names (max 8; { column, contains } for token columns, dropping metrics) into find_cost_change_factors. Returns { column } or { column, contains } plus metrics; do not invent columns. filterCel omitted or "" is unfiltered (not AWS-only). filterCel supports == null for unlabelled dimension values (e.g. cos_environment == null).
Effects: Read-only retrieval or computation; does not change saved resources or send messages. Scope: Authorized Costory workspace only.
EXAMPLES:
• "What should I split last month's EC2 cost by?" → { datePreset: "LAST_MONTH", filterCel: "cos_service_name in ["AmazonEC2"]" }
• "Costs of EC2 spiked last month, what should I investigate?" → { datePreset: "LAST_MONTH", compare: {}, filterCel: "cos_service_name in ["AmazonEC2"]" }
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": "suggest_groupby"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Current period end (YYYY-MM-DD), inclusive. Omit when using datePreset. | |
| from | No | Current period start (YYYY-MM-DD). Omit when using datePreset. | |
| slug | No | Organization slug. Omit to auto-detect from your account (fails if you belong to multiple orgs). | |
| compare | No | Optional reference (previous) period. Omit for current-window ranking. `{}` auto-derives from the current window (same helper as query). `{ from, to }` pins it. Pass this when the user asks what changed, before find_cost_change_factors. | |
| context | No | Optional context used only for analytics; it does not affect tool execution. Omit it by default. Do not include conversation text, personal information, or workspace data. | |
| filterCel | No | Optional CEL scope. Omit or "" for unfiltered (Billy where_clause TRUE). That is not an AWS-only filter even though columns_where_clause falls back to ["cos_provider"]. String methods: field.contains("x"), field.startsWith("x"), field.endsWith("x") (method-call, not infix). Unsupported CEL functions (e.g. lowerAscii) return INVALID_QUERY. | |
| llm_model | No | The model identifier you are running as, for example "claude-opus-4-8" or "gpt-5.2". Pass "unknown" if you are not certain. Recorded for the server developer's analytics. | |
| datePreset | No | ||
| conversation_id | No | The conversation_id this server returned earlier in this conversation, unchanged, including after later user messages. Omit it if you have none. Recorded for the server developer's analytics. |