Skip to main content
Glama

Update Allocation Rule

update_allocation_rule
Idempotent

Edit 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

NameRequiredDescriptionDefault
confirmNoSet 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.
enabledNoWhether the rule takes part in allocation. A disabled rule is stored but never applied.
rule_idYesThe rule to edit (list_allocation_rules). Required.
tag_keyNoTag key, for match_dimension="tag". CASE- AND HYPHEN-SENSITIVE: copy it exactly from get_available_tag_keys.
priorityNoResolution 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_valueNoTag value, for match_dimension="tag". Exact match only — the engine does not apply wildcard (glob) rules.
service_codeNoProvider-native service code, for match_dimension="service" (get_available_services lists them), e.g. "AmazonRDS".
cost_center_idNoThe cost center the matched spend is routed to (list_cost_centers). Must be a LEAF — a center with child centers cannot own rules.
include_impactNoAfter saving, report how the allocation moved (two dry-run queries, a few seconds). Default true. A failure here never undoes the write.
integration_idNoProvider 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_dimensionNoWhat 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).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Goes well beyond the annotations: it explains that the tool performs a read-merge before the replacing PUT (so a lone enabled:false does not reset priority), that changing match_dimension drops the old dimension's fields, that impact-report failure never undoes the write, and that four separate authorization conditions must all hold. It also describes the failure mode (names the missing condition, do not retry), though it stops short of stating idempotency or rate-limit behavior that the annotations imply.

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?

Front-loads what the tool does and the merge contract before auth and examples, and every paragraph carries information an agent needs. It is dense but long, and the inline endpoint path is marginal noise against an otherwise efficient structure.

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 compensates by naming the return payload (previous, rule, impact) and the include_impact:false opt-out. Auth prerequisites, refusal behavior, and field-preservation semantics are all covered for an 11-parameter mutation tool.

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 baseline is 3; the description adds real meaning on top by explaining the omit-to-preserve merge contract, that integration_id:null widens to all connections, and that match_dimension changes discard dimension-specific fields. It does not re-explain each field (priority ordering, tag case-sensitivity) but the schema already carries those.

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?

Names a specific verb (edit) and resource (cost-allocation rule), pins it to the backend endpoint (PUT /api/allocation-rules/{rule_id}), and enumerates the concrete edits it supports (retarget, tag fix, narrow to connection, priority, enable/disable). It also explicitly does not do deletes or bulk reordering, which separates it from create_allocation_rule and list_allocation_rules.

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?

Gives explicit routing: 'Run preview_allocation_rule with the same rule_id + fields first', and states that deleting and bulk reordering are unavailable here and belong in the CloudQuell dashboard. The when/when-not conditions are both spelled out rather than inferred.

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