Preview Allocation Rule (dry run)
preview_allocation_ruleDry-run an allocation rule BEFORE saving it: shows how this month-to-date's spend would move between cost centers if the rule existed (or if an existing rule were edited or disabled). Nothing is saved. Returns impact.candidate.capturedSpend (what the rule itself would claim), impact.unallocated before/after, and impact.changes — every cost center whose spend moves, largest first, with before/after/delta. A rule only claims spend no EARLIER-ranked rule already claimed: rules resolve by priority (lower first), first match wins, so a rule can also take spend away from another center, not only out of Unallocated — that shows up as a negative delta. warnings flags a $0 capture, a duplicate match, or a non-leaf target. NEW rule: pass cost_center_id + match_dimension and its fields ("tag" → tag_key + tag_value; "service" → service_code; "integration" → integration_id). EDIT: pass rule_id plus only the fields to change. The window is fixed by the backend to the current month to date. Requires a contributor-or-better role and a paid plan (the backend refuses a viewer with 403). Read-only — it changes nothing. WORKFLOW: get_allocation_breakdown (how much is Unallocated) → get_tag_coverage / run_cost_pivot to find who owns it → preview_allocation_rule → create_allocation_rule. Example: { "cost_center_id": "", "match_dimension": "tag", "tag_key": "team", "tag_value": "platform" }.
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": "preview_allocation_rule"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| enabled | No | Preview the rule enabled (default) or disabled — with rule_id, enabled:false previews switching that rule off. | |
| rule_id | No | Preview an EDIT of this existing rule (list_allocation_rules): the fields you pass override its stored values, everything else is kept. Omit to preview a NEW rule. | |
| tag_key | No | Tag key, for match_dimension="tag". CASE- AND HYPHEN-SENSITIVE: copy it exactly from get_available_tag_keys. | |
| priority | No | Resolution order — LOWER is checked FIRST and the first matching rule claims the dollar. Default 100 (the dashboard default). Ties go to the older rule, so a new rule at an existing priority ranks after the rules already there. | |
| tag_value | No | Tag value, for match_dimension="tag". Exact match only — the engine does not apply wildcard (glob) rules. | |
| service_code | No | Provider-native service code, for match_dimension="service" (get_available_services lists them), e.g. "AmazonRDS". | |
| cost_center_id | No | The cost center the matched spend is routed to (list_cost_centers). Must be a LEAF — a center with child centers cannot own rules. | |
| integration_id | No | Provider connection (list_integrations). REQUIRED for match_dimension="integration". For "tag"/"service" rules it is an optional scope: omit or null = match across every connection. | |
| integration_ids | No | Limit the preview to these provider connections. Omit for the whole organization. | |
| match_dimension | No | What the rule matches on. "tag" = a tag key/value pair (needs tag_key + tag_value); "service" = a provider-native service code such as "AmazonEC2" (needs service_code); "integration" = everything from one provider connection (needs integration_id). | |
| response_format | No | concise = the cost centers whose spend changed, plus the candidate rule's own capture (default). detailed = additionally the full before/after cost-center lists. | concise |