Skip to main content
Glama

Preview Allocation Rule (dry run)

preview_allocation_rule
Read-only

Dry-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

NameRequiredDescriptionDefault
enabledNoPreview the rule enabled (default) or disabled — with rule_id, enabled:false previews switching that rule off.
rule_idNoPreview 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_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.
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.
integration_idsNoLimit the preview to these provider connections. Omit for the whole organization.
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).
response_formatNoconcise = the cost centers whose spend changed, plus the candidate rule's own capture (default). detailed = additionally the full before/after cost-center lists.concise

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the readOnlyHint annotation, the description discloses the fixed month-to-date window, contributor-or-better role and paid-plan requirements, and backend 403 refusal for viewers. It also explains priority resolution, negative deltas, and warning conditions, which materially help an agent interpret results.

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?

The definition is front-loaded with the dry-run purpose and then structured into return values, matching behavior, edit/new guidance, requirements, and workflow. It is dense and mostly earns its length, but there is some redundancy between 'Nothing is saved' and 'Read-only — it changes nothing.'

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?

For an 11-parameter tool with no output schema, the description is unusually complete. It describes the simulated return fields, warnings, role and plan requirements, parameter modes for new versus edited rules, and the surrounding workflow.

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 the schema already documents the parameters well. The description adds useful semantics beyond the schema by explaining how to preview a NEW versus EDITED rule and how priority and first-match resolution affect the previewed allocation.

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?

The description opens with a precise verb and resource: dry-run an allocation rule before saving it. It clearly distinguishes the tool from mutation siblings by stating that nothing is saved and by placing it before create_allocation_rule in the workflow.

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?

It explicitly says when to use the tool, including previewing a new rule, an edit, or disabling an existing rule via enabled:false. The workflow names the alternatives and the correct sequence: get_allocation_breakdown, get_tag_coverage or run_cost_pivot, preview_allocation_rule, then create_allocation_rule.

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