Update Allocation Rule
update_allocation_ruleEdit an existing cost-allocation rule (PUT /api/allocation-rules/{rule_id}). Pass rule_id and ONLY the fields to change — the tool reads the stored rule and keeps everything you omit (the backend PUT replaces every column, so this merge is what stops a lone enabled:false from also resetting the priority). Typical edits: retarget (cost_center_id), fix a tag value, narrow to one connection (integration_id; null widens back to all), change priority (lower = checked first), or switch the rule off/on (enabled). Changing match_dimension drops the old dimension's fields. Run preview_allocation_rule with the same rule_id + fields first. Returns previous (the stored values before the edit), the saved rule, and impact (before/after allocation, current month to date) unless include_impact:false. Deleting rules and bulk reordering are not available here — use the CloudQuell dashboard. WRITE TOOL — MCP WRITES ARE OFF BY DEFAULT FOR EVERY ORGANIZATION. This call needs ALL FOUR of: the admin:write scope, the organization switch turned on (an org admin enables it in Settings → Organization → AI agent access), an admin or super_admin org role, and confirm:true. Missing any one of them it refuses and changes nothing, and the error names which one — relay that to the user rather than retrying. Read-only cak_ API keys can never perform it. Example: { "rule_id": "", "enabled": false, "confirm": true } switches a rule off; { "rule_id": "", "priority": 10, "confirm": true } moves it ahead of the default-priority rules.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"rule_id": "<rule_id>"
},
"name": "update_allocation_rule"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| confirm | No | Set to true to actually make the change. Required: the tool refuses the mutation unless confirm:true is present. Authorization for the change itself is your org role, checked server-side. | |
| enabled | No | Whether the rule takes part in allocation. A disabled rule is stored but never applied. | |
| rule_id | Yes | The rule to edit (list_allocation_rules). Required. | |
| 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. | |
| include_impact | No | After saving, report how the allocation moved (two dry-run queries, a few seconds). Default true. A failure here never undoes the write. | |
| 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. | |
| 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). |